From 5a1013b8bacf7797f910240323e5061b321617c4 Mon Sep 17 00:00:00 2001 From: nacin Date: Wed, 24 Feb 2010 00:18:18 +0000 Subject: [PATCH] Don't use private wpdb vars. See #11644 git-svn-id: http://svn.automattic.com/wordpress/trunk@13353 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment.php | 4 +--- xmlrpc.php | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 57eb9faa02..e3499c802c 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -1382,9 +1382,7 @@ function wp_update_comment($commentarr) { $comment_approved = 1; $data = compact('comment_content', 'comment_author', 'comment_author_email', 'comment_approved', 'comment_karma', 'comment_author_url', 'comment_date', 'comment_date_gmt'); - $wpdb->update($wpdb->comments, $data, compact('comment_ID')); - - $rval = $wpdb->rows_affected; + $rval = $wpdb->update( $wpdb->comments, $data, compact( 'comment_ID' ) ); clean_comment_cache($comment_ID); wp_update_comment_count($comment_post_ID); diff --git a/xmlrpc.php b/xmlrpc.php index d52e58d114..7f96316818 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -3203,10 +3203,8 @@ class wp_xmlrpc_server extends IXR_Server { return new IXR_Error(33, __('The specified target URL cannot be used as a target. It either doesn’t exist, or it is not a pingback-enabled resource.')); // Let's check that the remote site didn't already pingback this entry - $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $post_ID, $pagelinkedfrom) ); - - if ( $wpdb->num_rows ) // We already have a Pingback from this URL - return new IXR_Error(48, __('The pingback has already been registered.')); + if ( $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $post_ID, $pagelinkedfrom) ) ) + return new IXR_Error( 48, __( 'The pingback has already been registered.' ) ); // very stupid, but gives time to the 'from' server to publish ! sleep(1);