Prevent fatal error if $wgCookieSetOnAutoblock is changed to false
authorKaldari <rkaldari@wikimedia.org>
Mon, 28 Nov 2016 19:44:36 +0000 (11:44 -0800)
committerKaldari <rkaldari@wikimedia.org>
Mon, 28 Nov 2016 19:44:36 +0000 (11:44 -0800)
... and user still has a block cookie set.

Bug: T151097
Change-Id: I5a2fdc53250f629579428efbed39f6fb1f1531f3

includes/user/User.php

index 789c55c..82d8806 100644 (file)
@@ -1649,7 +1649,7 @@ class User implements IDBAccessObject {
                                        // If the block is not valid, clear the block cookie (but don't delete it,
                                        // because it needs to be cleared from LocalStorage as well and an empty string
                                        // value is checked for in the mediawiki.user.blockcookie module).
-                                       $block->setCookie( $this->getRequest()->response(), true );
+                                       $tmpBlock->setCookie( $this->getRequest()->response(), true );
                                }
                        }
                }