Trigger load of user data in User::getBlockStatus() before we
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 14 May 2008 23:42:15 +0000 (23:42 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 14 May 2008 23:42:15 +0000 (23:42 +0000)
start changing member variables.

Otherwise something ends up stomping on $this->mBlockedby when
things get lazy-loaded later, causing false positive block hits
due to -1 !== 0. Probably session-related... Nothing should be
overwriting mBlockedby, surely?

This was giving me blank "you are blocked" messages.... but only
when doing *section edits on SSL*, not regular edits, nor section
edits on non-SSL wikipedia. Weeeeeeird

includes/User.php

index 9e71e2e..9ec8a34 100644 (file)
@@ -1002,6 +1002,13 @@ class User {
                wfProfileIn( __METHOD__ );
                wfDebug( __METHOD__.": checking...\n" );
 
+               // Initialize data...
+               // Otherwise something ends up stomping on $this->mBlockedby when
+               // things get lazy-loaded later, causing false positive block hits
+               // due to -1 !== 0. Probably session-related... Nothing should be
+               // overwriting mBlockedby, surely?
+               $this->load();
+               
                $this->mBlockedby = 0;
                $this->mHideName = 0;
                $ip = wfGetIP();