From: Brion Vibber Date: Wed, 14 May 2008 23:42:15 +0000 (+0000) Subject: Trigger load of user data in User::getBlockStatus() before we X-Git-Tag: 1.31.0-rc.0~47622 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=bc79cb0f6fd9bee6bf1ee5cd583883e937f407e9;p=lhc%2Fweb%2Fwiklou.git Trigger load of user data in User::getBlockStatus() before we 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 --- diff --git a/includes/User.php b/includes/User.php index 9e71e2e5ea..9ec8a34c39 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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();