Bug Description
As we have provided filter webp_uploads_upload_image_mime_transforms for the mime type transforms in any case user does not want to transform the mime type then they just return empty, true/false or array() then this file helper.php code is not require because $transforms = (array) apply_filters( 'webp_uploads_upload_image_mime_transforms', $default_transforms ); filter always retunt array value.
Return type empty
add_filter('webp_uploads_upload_image_mime_transforms', function () {
return;
});
Return type true/false
add_filter('webp_uploads_upload_image_mime_transforms', function () {
return false;
});
Return type empty array:
add_filter('webp_uploads_upload_image_mime_transforms', function () {
return array();
});
Also, we have to check if an array is null and then return an empty array so it can't execute next foreach code.
Additional Context
- PHP Version: 8.0.15
- OS: Windows
- Browser: Chrome
- Plugin Version: 1.1.0
Bug Description
As we have provided filter
webp_uploads_upload_image_mime_transformsfor the mime type transforms in any case user does not want to transform the mime type then they just returnempty,true/falseorarray()then this file helper.php code is not require because$transforms = (array) apply_filters( 'webp_uploads_upload_image_mime_transforms', $default_transforms );filter always retunt array value.Return type empty
Return type true/false
Return type empty array:
Also, we have to check if an array is null and then return an empty array so it can't execute next foreach code.
Additional Context