Pass mimes when checking file type

#9207
This commit is contained in:
Mike Jolley 2015-10-06 15:01:41 +01:00
parent b240de4204
commit f1c6b3628a
1 changed files with 2 additions and 2 deletions

View File

@ -1177,7 +1177,7 @@ class WC_Meta_Box_Product_Data {
// Validate the file extension
if ( in_array( $file_is, array( 'absolute', 'relative' ) ) ) {
$file_type = wp_check_filetype( strtok( $file_url, '?' ) );
$file_type = wp_check_filetype( strtok( $file_url, '?' ), $allowed_file_types );
$parsed_url = parse_url( $file_url, PHP_URL_PATH );
$extension = pathinfo( $parsed_url, PATHINFO_EXTENSION );
@ -1465,7 +1465,7 @@ class WC_Meta_Box_Product_Data {
// Validate the file extension
if ( in_array( $file_is, array( 'absolute', 'relative' ) ) ) {
$file_type = wp_check_filetype( strtok( $file_url, '?' ) );
$file_type = wp_check_filetype( strtok( $file_url, '?' ), $allowed_file_types );
$parsed_url = parse_url( $file_url, PHP_URL_PATH );
$extension = pathinfo( $parsed_url, PATHINFO_EXTENSION );