Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#21828 closed defect (bug) (duplicate)

ERR_NOTICE in wp_mime_type_icon

Reported by: mark8barnes's profile mark8barnes Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.4.1
Component: Gallery Keywords: has-patch
Focuses: Cc:

Description

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.

Attachments (1)

wp_mime_type_icon.patch (505 bytes) - added by mark8barnes 13 years ago.

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
13 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 3.5

#2 @ocean90
13 years ago

  • Keywords commit removed
  • Milestone 3.5 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

#3 @nacin
13 years ago

Hi mark8barnes, neither koopersmith nor I saw this ticket before it went in. I'll make sure you're listed on the 3.5 credits page as if you received "props" for this patch. Cheers!

#4 @mark8barnes
13 years ago

Thanks, nacin.

#5 @nacin
13 years ago

#21614 was marked as a duplicate.

Note: See TracTickets for help on using tickets.