Ticket #18491: 18491.patch

File 18491.patch, 540 bytes (added by SergeyBiryukov, 21 months ago)
  • wp-includes/post-template.php

     
    11521152        $id = intval($id); 
    11531153        $_post = & get_post( $id ); 
    11541154 
    1155         if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) ) 
     1155        if ( empty($_post) || ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) ) 
    11561156                return __('Missing Attachment'); 
    11571157 
    11581158        if ( $permalink )