Closed sbulen closed 1 year ago
Problem exists in 1.1.8 & 2.0.
Arh!
Can you confirm the error was on line 222? it should be in the admin error log. I can get a similar error on 1.1.8/7.4 but my local 1.1.9/8.1 and 2.0/8.1 are not tossing it (but to note what is on my local is more recent than the repo atm)
Well .... Looks like we may have some a common problem(s) in that area.
First up
// Local and global do not play nicely together.
if (!empty($_POST['localCookies']) && empty($_POST['globalCookies']))
unset ($_POST['globalCookies']);
Looks a bit odd, why unset the value if its already empty? Seems like the intention was to unset globalCookies should localCookies be enabled. One could probably drop the second empty check (I don't think unset will care) or negate the second empty.
Second one is just for fun. Empty out the cookie name (I don't think it matters if local or global are set) and save. You will be logged out and when you try to log back in
Fatal error: Uncaught ValueError: setcookie(): Argument #1 ($name) cannot be empty in /var/www/smf21/Sources/Subs-Auth.php:883
Then reach for your db tools or repairsettings 🤯
ManageServer.php, line 300. I am current with the development branch.
Oddly, I couldn't reproduce it on php8.1.
After switching back to php8.0, I saw it again. This might be specific to 8.0, not 8.1.
Yup, that is the same line, 2.0 vs 1.1 ... seems like a 8.0 issue where unsetting an array key that does not exist (in an array that does exist) raises an error. Its that incorrect empty check I referenced in the previous note that would prevent that. Oh Joy
Describe the bug 'Undefined array key "globalCookies"' upon disabling global cookies & enabling local cookies.
ElkArte info
To Reproduce Steps to reproduce the behavior:
Screenshots