Make WordPress Core

Opened 18 years ago

Closed 18 years ago

#8991 closed defect (bug) (fixed)

get_posts() fails to retrieve attachments with mime type like (type/sub+suffix)

Reported by: Sam_a Owned by:
Priority: normal Milestone: 2.8
Component: Media Version: 2.7
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

get_posts() and related functions can't retrieve attachments whose post_mime_type field has a valid compound subtype like atom+xml, xspf+xml, & c.

A fix is to add the plus character + to the $mime_subgroup expression in wp_post_mime_type_where().

Attachments (1)

wp_post_mime_type_where_suffix.diff (623 bytes ) - added by Sam_a 18 years ago.
Fixes wp_post_mime_type_where() so it works correctly for mime types like (type/sub+suffix)

Download all attachments as: .zip

Change History (4)

@Sam_a
18 years ago

Fixes wp_post_mime_type_where() so it works correctly for mime types like (type/sub+suffix)

#1 @Sam_a
18 years ago

  • Keywords has-patch added

Patch works for me in revision 10347.

Without the patch, wp_post_mime_type_where() strips the + and returns, e.g., (post_mime_type = 'application/atomxml'), which won't match anything.

#2 @Sam_a
18 years ago

  • Version2.7

#3 @ryan
18 years ago

  • Resolutionfixed
  • Status newclosed

(In [10502]) Allow + in mime type regex. Props Sam_a. fixes #8991

Note: See TracTickets for help on using tickets.