We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef9a9f9 commit 7443e68Copy full SHA for 7443e68
plugins/webp-uploads/hooks.php
@@ -822,8 +822,11 @@ function webp_uploads_convert_palette_png_to_truecolor( $file ): array {
822
if ( ! isset( $file['tmp_name'], $file['name'] ) ) {
823
return $file;
824
}
825
-
826
- if ( 'png' !== strtolower( pathinfo( $file['name'], PATHINFO_EXTENSION ) ) ) {
+ if ( isset( $file['type'] ) && is_string( $file['type'] ) ) {
+ if ( 'image/png' !== strtolower( $file['type'] ) ) {
827
+ return $file;
828
+ }
829
+ } elseif ( 'image/png' !== wp_check_filetype( $file['name'] )['type'] ) {
830
831
832
0 commit comments