Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#8595 closed defect (bug) (fixed)

Improve `bp_attachments_get_allowed_types()`

Reported by: imath Owned by: imath
Priority: normal Milestone: 10.0.0
Component: Core Version: 2.4.0
Severity: normal Keywords: has-patch
Cc:

Description

Just found this function was wrongly getting video extensions for the audio ones.

Attachments (1)

8595.patch (1.0 KB ) - added by imath 5 years ago.

Download all attachments as: .zip

Change History (3)

@imath
5 years ago

#1 @imath
5 years ago

  • Resolutionfixed
  • Status assignedclosed

In 13132:

Improve the bp_attachments_get_allowed_types() function

  • Make sure requesting for the 'audio' type returns a list of audio file extensions.
  • Use the wp_get_ext_types() function so that passing the 'image', 'document', 'spreadsheet', 'interactive', 'text', 'archive', 'code' types to the function will return the requested type extensions.

Fixes #8595

#2 @imath
5 years ago

In 13134:

Improve 2 Core Attachments functions

  • stop using a switch() statement in favor of some if/else ones to avoid a possible notice error when getting all allowed BP Attachements.
  • stop using wp_match_mime_types() inside the bp_attachments_get_allowed_mimes() function. Using wp_match_mime_types() was generating unconsistent results when trying to get all BP Attachments allowed mime types.

Fixes #8595 (really)

Note: See TracTickets for help on using tickets.