Ensure $post_id is defined in wp_mime_type_icon() to prevent notices when a valid mime type string is provided. see #21835.

git-svn-id: http://core.svn.wordpress.org/trunk@21782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-09-07 21:04:58 +00:00
parent aa543734b8
commit 50b120ad64

View File

@ -4150,8 +4150,9 @@ function wp_attachment_is_image( $post_id = 0 ) {
function wp_mime_type_icon( $mime = 0 ) { function wp_mime_type_icon( $mime = 0 ) {
if ( !is_numeric($mime) ) if ( !is_numeric($mime) )
$icon = wp_cache_get("mime_type_icon_$mime"); $icon = wp_cache_get("mime_type_icon_$mime");
$post_id = 0;
if ( empty($icon) ) { if ( empty($icon) ) {
$post_id = 0;
$post_mimes = array(); $post_mimes = array();
if ( is_numeric($mime) ) { if ( is_numeric($mime) ) {
$mime = (int) $mime; $mime = (int) $mime;