MagestyApps / module-web-images

Magento 2 module for uploading images in optimised formats (SVG, WebP, etc.)
https://www.magestyapps.com
93 stars 16 forks source link

Fix for Type Error occurred when creating object: Magento\MediaStorage\Model\File\Validator\NotProtectedExtension\Interceptor, array_keys(): Argument #1 ($array) must be of type array, string given [] [] #18

Closed maquowicz closed 1 year ago

maquowicz commented 1 year ago

Hey

Nice work! Thanks for sharing!

Found that module doesn't work in M2.4.5 running php8.1

in vendor/magestyapps/module-web-images/Plugin/File/Validator/NotProtectedExtensionPlugin.php around line 40 before foreach loop add:

$result = is_string($result) ? explode(",", $result) : $result;

MagestyApps commented 1 year ago

Hi @maquowicz

Thanks for the detailed report of the issue. With your help, we fixed the issue and released it in version 1.1.7.