Switching $wgCookieSetOnAutoblock from true to false can cause fatal error
Closed, ResolvedPublic1 Estimated Story Points

Description

Currently, if $wgCookieSetOnAutoblock is set to true and someone gets a block cookie set, but then $wgCookieSetOnAutoblock is set to false (and the user's cookie still exists), they will get a fatal error when they try to edit a page:

Fatal error: Call to a member function setCookie() on a non-object in /Users/kaldari/Sites/core/includes/user/User.php on line 1665

This is because it's trying to call setCookie() on $block (to clear it), but $block isn't an instantiated object in this case.

Event Timeline

kaldari set the point value for this task to 1.

Change 322377 had a related patch set uploaded (by Kaldari):
Prevent fatal error if $wgCookieSetOnAutoblock is changed to false

https://gerrit.wikimedia.org/r/322377

Change 322377 merged by jenkins-bot:
Prevent fatal error if $wgCookieSetOnAutoblock is changed to false

https://gerrit.wikimedia.org/r/322377

kaldari moved this task from Ready to Q1 2018-19 on the Community-Tech-Sprint board.