Skip to content

Commit

Permalink
Change formatting of allowed extensions array
Browse files Browse the repository at this point in the history
  • Loading branch information
benlk committed Sep 8, 2024
1 parent cf96557 commit ff40a44
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion includes/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,18 @@ function process_media( $url, $post_id, $args = [] ) {
*
* @return {array} Media extensions to be processed.
*/
$allowed_extensions = apply_filters( 'dt_allowed_media_extensions', array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' ), $url, $post_id );
$allowed_extensions = apply_filters(
'dt_allowed_media_extensions',
array(
'jpg',
'jpeg',
'jpe',
'gif',
'png'
),
$url,
$post_id
);
preg_match( '/[^\?]+\.(' . implode( '|', $allowed_extensions ) . ')\b/i', $url, $matches );
if ( ! $matches ) {
$media_name = null;
Expand Down

0 comments on commit ff40a44

Please sign in to comment.