From d539c11a9444bdc4ba8fd8db76304d6317c6e169 Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Fri, 7 Sep 2012 21:04:58 +0000 Subject: [PATCH] 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 --- wp-includes/post.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 4bc1e7e684..4be2d547a5 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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;