[wp-trac] [WordPress Trac] #21828: ERR_NOTICE in wp_mime_type_icon
WordPress Trac
wp-trac at lists.automattic.com
Thu Sep 6 23:35:37 UTC 2012
#21828: ERR_NOTICE in wp_mime_type_icon
--------------------------+-----------------------------
Reporter: mark8barnes | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Gallery | Version: 3.4.1
Severity: minor | Keywords: has-patch
--------------------------+-----------------------------
There's a bug in wp_mime_type_icon (wp-includes/post.php) which gives an
ERR_NOTICE when a non-numeric mime-type is retrieved from the cache. The
second line of the following code reproduces the error:
{{{
$icon1 = wp_mime_type_icon ('application/ogg'); // No cache, so no error
$icon2 = wp_mime_type_icon ('application/ogg'); // Uses cache, so gives
error
}}}
The full message is `Notice: Undefined variable: post_id in
D:\web\htdocs\wordpress\wp-includes\post.php on line 4127`
The problem is obvious from the code and easy to fix. The attached patch
does that.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21828>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list