Ticket #6644: prepared_queries13.diff
| File prepared_queries13.diff, 1.3 KB (added by , 18 years ago) |
|---|
-
wp-admin/edit.php
205 205 206 206 if ( 1 == count($posts) && is_singular() ) : 207 207 208 $comments = $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date");208 $comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) ); 209 209 if ( $comments ) : 210 210 // Make sure comments, post, and post_author are cached 211 211 update_comment_cache($comments); -
wp-admin/edit-pages.php
175 175 176 176 if ( 1 == count($posts) && is_singular() ) : 177 177 178 $comments = $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date");178 $comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $id) ); 179 179 if ( $comments ) : 180 180 // Make sure comments, post, and post_author are cached 181 181 update_comment_cache($comments);