Changeset 7645 for trunk/xmlrpc.php
- Timestamp:
- 04/14/2008 04:13:25 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/xmlrpc.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/xmlrpc.php
r7617 r7645 1353 1353 foreach( $attachments as $file ) { 1354 1354 if( strpos( $post_content, $file->guid ) !== false ) { 1355 $wpdb->query( "UPDATE {$wpdb->posts} SET post_parent = '$post_ID' WHERE ID = '{$file->ID}'");1355 $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->posts} SET post_parent = %d WHERE ID = %d", $post_ID, $file->ID) ); 1356 1356 } 1357 1357 } … … 2094 2094 } 2095 2095 2096 $comments = $wpdb->get_results( "SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = $post_ID");2096 $comments = $wpdb->get_results( $wpdb->prepare("SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) ); 2097 2097 2098 2098 if (!$comments) { … … 2207 2207 // ...or a string #title, a little more complicated 2208 2208 $title = preg_replace('/[^a-z0-9]/i', '.', $urltest['fragment']); 2209 $sql = "SELECT ID FROM $wpdb->posts WHERE post_title RLIKE '$title'";2209 $sql = $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_title RLIKE %s", $title); 2210 2210 if (! ($post_ID = $wpdb->get_var($sql)) ) { 2211 2211 // returning unknown error '0' is better than die()ing … … 2236 2236 2237 2237 // Let's check that the remote site didn't already pingback this entry 2238 $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post_ID' AND comment_author_url = '$pagelinkedfrom'");2238 $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $post_ID, $pagelinkedfrom) ); 2239 2239 2240 2240 if ( $wpdb->num_rows ) // We already have a Pingback from this URL … … 2345 2345 } 2346 2346 2347 $comments = $wpdb->get_results( "SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = $post_ID");2347 $comments = $wpdb->get_results( $wpdb->prepare("SELECT comment_author_url, comment_content, comment_author_IP, comment_type FROM $wpdb->comments WHERE comment_post_ID = %d", $post_ID) ); 2348 2348 2349 2349 if (!$comments) {
Note: See TracChangeset
for help on using the changeset viewer.