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: https://develop.svn.wordpress.org/trunk@21782 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith
2012-09-07 21:04:58 +00:00
parent 626a4b2a56
commit d539c11a94

View File

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