[wp-trac] [WordPress Trac] #22372: Bug in wp_attachment_is_image
WordPress Trac
noreply at wordpress.org
Tue Nov 6 20:37:18 UTC 2012
#22372: Bug in wp_attachment_is_image
-----------------------------+--------------------------
Reporter: odedstr2 | Type: defect (bug)
Status: new | Priority: normal
Milestone: Awaiting Review | Component: General
Version: 3.4.2 | Severity: major
Keywords: |
-----------------------------+--------------------------
On '''wp-includes/post.php
''' Line '''4031''':
{{{
if ( !$file = get_attached_file( $post->ID ) )
}}}
SHOULD BE:
{{{
if ( !$file = get_attached_file( $post_id ) )
}}}
By the way, the variable name $post_id is very bad, as this is the
Attachment ID, not the Post ID. Probably this variable naming mistake
resulted in this bug.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22372>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list