Skip to content

Commit e39b2c7

Browse files
committed
Improve file type check by using wp_check_filetype_and_ext
1 parent 62f767c commit e39b2c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/webp-uploads/hooks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ function webp_uploads_convert_palette_png_to_truecolor( $file ) {
826826
if ( 'image/png' !== strtolower( $file['type'] ) ) {
827827
return $file;
828828
}
829-
} elseif ( 'image/png' !== wp_check_filetype( $file['name'] )['type'] ) {
829+
} elseif ( 'image/png' !== wp_check_filetype_and_ext( $file['tmp_name'], $file['name'] )['type'] ) {
830830
return $file;
831831
}
832832

0 commit comments

Comments
 (0)