Line ending fixes and commenting cleanups from Scott Reilly

git-svn-id: http://svn.automattic.com/wordpress/trunk@2556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt
2005-04-20 03:37:23 +00:00
parent 07730d904d
commit 68b4b3c61c
4 changed files with 282 additions and 277 deletions

View File

@@ -27,11 +27,9 @@ function trackback_response($error = 0, $error_message = '') {
// trackback is done by a POST
$request_array = 'HTTP_POST_VARS';
if ( empty($_GET['tb_id']) ) {
if ( !$_GET['tb_id'] ) {
$tb_id = explode('/', $_SERVER['REQUEST_URI']);
$tb_id = intval($tb_id[count($tb_id)-1]);
} else {
$tb_id = intval($_GET['tb_id']);
$tb_id = intval( $tb_id[ count($tb_id) - 1 ] );
}
$tb_url = $_POST['url'];
@@ -54,7 +52,7 @@ if ( function_exists('mb_convert_encoding') ) { // For international trackbacks
if ( is_single() || is_page() )
$tb_id = $posts[0]->ID;
if ( !$tb_id )
if ( !intval( $tb_id ) )
trackback_response(1, 'I really need an ID for this to work.');
if (empty($title) && empty($tb_url) && empty($blog_name)) {
@@ -68,7 +66,7 @@ if ( !empty($tb_url) && !empty($title) && !empty($tb_url) ) {
$pingstatus = $wpdb->get_var("SELECT ping_status FROM $wpdb->posts WHERE ID = $tb_id");
if ('open' != $pingstatus)
if ( 'open' != $pingstatus )
trackback_response(1, 'Sorry, trackbacks are closed for this item.');
$title = wp_specialchars( strip_tags( $title ) );