Closed klodeckl closed 11 months ago
Hi @klodeckl,
the only explenation I currently have in mind that some users have a mess in their cookie value and the json_decode just returns a boolean.
Anyway, I will try to adjust this to prevent this exception.
Greetings Daniel
Thank you! :) But how could get mess in the cookie value?
I changed the function now to the following:
if (false === self::hasCookie($name) || is_bool(json_decode($_COOKIE[$name], true)) === true) { return null; }
return json_decode($_COOKIE[$name], true);
I will check if the error won’t occur anymore now. Maybe instead of is_bool === true it would be better to check for is_array || is_null === false.
Hi @klodeckl,
I solved this here: 22bfbf2fa313ee5378da679b3d850805f0e0d6c2
This shouldn't happen except a user/script/adblocker tries to manipulate the consent cookie somehow, but this should make it safe now. (Broken cookies will also be ignored by the JavaScript prompting the modal and save it properly)
Greetings Daniel
Hi @klodeckl,
an update with this fix is now released in TER.
Greetings Daniel
Thank you!
Hi,
my TYPO3 log gets floodes with messages like:
Core: Exception handler (WEB): Uncaught TYPO3 Exception: Return value of Mindshape\MindshapeCookieConsent\Utility\CookieUtility::getCookieValue() must be of the type array or null, bool returned | TypeError thrown in file /xyz/typo3conf/ext/mindshape_cookie_consent/Classes/Utility/CookieUtility.php in line 34. Requested URL: https://www.tld.com/path/
Currently I don’t know how to reproduce the issue myself.
TYPO3 10, mindshape_cookie_consent 2.2.5