Skip to:
Content

BuddyPress.org

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#8595 closed defect (bug) (fixed)

Improve `bp_attachments_get_allowed_types()`

Reported by: imath's profile imath Owned by: imath's profile imath
Milestone: 10.0.0 Priority: normal
Severity: normal Version: 2.4.0
Component: Core 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 2 years ago.

Download all attachments as: .zip

Change History (3)

@imath
2 years ago

#1 @imath
2 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

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
2 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.