Line ending fixes and commenting cleanups from Scott Reilly

git-svn-id: https://develop.svn.wordpress.org/trunk@2556 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg
2005-04-20 03:37:23 +00:00
parent debd8e0e5f
commit 2e3c23045c
4 changed files with 282 additions and 277 deletions
+4 -6
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 ) );