Page MenuHomePhabricator

Switching $wgCookieSetOnAutoblock from true to false can cause fatal error
Closed, ResolvedPublic1 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 created this task.Nov 19 2016, 12:12 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 19 2016, 12:12 AM
kaldari triaged this task as High priority.Nov 19 2016, 12:12 AM
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

kaldari claimed this task.Nov 19 2016, 12:26 AM

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

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

kaldari closed this task as Resolved.Nov 28 2016, 10:43 PM
kaldari moved this task from Ready to Q1 2018-19 on the Community-Tech-Sprint board.
DannyH moved this task from Untriaged to Archive on the Community-Tech board.Dec 7 2016, 7:15 PM