Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#22532 closed defect (bug) (fixed)

It is assumed that a mime type has a minimum of two parts when splitted by "/"

Reported by: chouby's profile Chouby Owned by: ryan's profile ryan
Milestone: 3.5 Priority: low
Severity: normal Version: 3.5
Component: Media Keywords: has-patch
Focuses: Cc:

Description (last modified by nacin)

While testing the version 3.5-beta3-22734, I got the following notice (due to an attachment created without media file):
PHP Notice: Undefined offset: 1 in /wp-includes/media.php on line 1242
The line is:

list( $type, $subtype ) = explode( '/', $attachment->post_mime_type );

See also: #22186

Attachments (1)

22532.patch (830 bytes) - added by SergeyBiryukov 11 years ago.

Download all attachments as: .zip

Change History (5)

#1 @nacin
11 years ago

  • Description modified (diff)
  • Milestone changed from Awaiting Review to 3.5
  • Priority changed from normal to low

Yeah, we should avoid making this assumption.

#2 @SergeyBiryukov
11 years ago

  • Keywords has-patch added

#3 @ryan
11 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In 22830:

Handle attachments that have an empty mime type or a mime type without a subtype.

Props SergeyBiryukov
fixes #22532

Note: See TracTickets for help on using tickets.