Opened 13 years ago
Closed 13 years ago
#22372 closed defect (bug) (invalid)
Bug in wp_attachment_is_image
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | trivial | Version: | 3.4.2 |
| Component: | Media | Keywords: | |
| Focuses: | Cc: |
Description
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.
Change History (1)
Note: See
TracTickets for help on using
tickets.
$post->IDis actually the same value, since$postis set earlier in line 4028:http://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/post.php#L4028
It could be
$post_idas well, but there's no bug here.