Changeset 8173

Show
Ignore:
Timestamp:
06/23/08 21:50:19 (4 months ago)
Author:
ryan
Message:

Don't get post ancestors if post not found. Props Sam_a. fixes #6953

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/post.php

    r8096 r8173  
    171171        if ( ! $_post = wp_cache_get($post, 'posts') ) { 
    172172            $_post = & $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d LIMIT 1", $post)); 
     173            if ( ! $_post ) 
     174                return $null; 
    173175            _get_post_ancestors($_post); 
    174176            wp_cache_add($_post->ID, $_post, 'posts');