Changeset 3012 for trunk/wp-includes/functions.php
- Timestamp:
- 11/07/2005 11:09:09 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r3011 r3012 558 558 $_post = & $post_cache[$post]; 559 559 else { 560 $query = "SELECT * FROM $wpdb->posts WHERE ID = '$post' ";560 $query = "SELECT * FROM $wpdb->posts WHERE ID = '$post' LIMIT 1"; 561 561 $post_cache[$post] = & $wpdb->get_row($query); 562 562 $_post = & $post_cache[$post]; … … 597 597 // Got it. 598 598 } else { 599 $query = "SELECT * FROM $wpdb->posts WHERE ID= '$page' ";599 $query = "SELECT * FROM $wpdb->posts WHERE ID= '$page' LIMIT 1"; 600 600 $_page = & $wpdb->get_row($query); 601 601 wp_cache_add($_page->ID, $_page, 'pages'); … … 641 641 } else { 642 642 if ( ! $_category = wp_cache_get($category, 'category') ) { 643 $_category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = '$category' ");643 $_category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = '$category' LIMIT 1"); 644 644 wp_cache_add($category, $_category, 'category'); 645 645 } … … 676 676 } else { 677 677 if ( !isset($comment_cache[$comment]) ) { 678 $_comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment' ");678 $_comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment' LIMIT 1"); 679 679 $comment_cache[$comment->comment_ID] = & $_comment; 680 680 } else {
Note: See TracChangeset
for help on using the changeset viewer.