thecodingmachine / mouf

The Mouf PHP framework: an open-source PHP framework providing an easy way to download, install, use and reuse components, with a graphical user interface.
MIT License
54 stars 28 forks source link

Error when loading Mouf if cookie contains array #157

Open Zheness opened 5 years ago

Zheness commented 5 years ago

Hello Mouf team !

I have an issue when loading Mouf home page:

Warning: urlencode() expects parameter 1 to be string, array given in /var/www/html/vendor/mouf/mouf/src/Mouf/Reflection/MoufReflectionProxy.php on line 297

I found out it's because one of my $_COOKIE is an array:

key = webform-941[1563959232] value = 1563959232

(Coming from Drupal when saving a form)

When it arrive into PHP, the $value is:

{"1563959232":"1563959232"}

So considered as array.

Is it possible to fix ?

Thank you :)

https://github.com/thecodingmachine/mouf/blob/b6a11bfd4a93859c1014d5b3d54ee99314f5fc7b/src/Mouf/Reflection/MoufReflectionProxy.php#L297