WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/19/2009 05:58:11 PM (9 years ago)
Author:
ryan
Message:

Return if no comment queried

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment.php

    r12183 r12223  
    133133function &get_comment(&$comment, $output = OBJECT) {
    134134    global $wpdb;
     135    $null = null;
    135136
    136137    if ( empty($comment) ) {
     
    147148        } elseif ( ! $_comment = wp_cache_get($comment, 'comment') ) {
    148149            $_comment = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment));
     150            if ( ! $_comment )
     151                return $null;
    149152            wp_cache_add($_comment->comment_ID, $_comment, 'comment');
    150153        }
Note: See TracChangeset for help on using the changeset viewer.