r34841 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34840‎ | r34841 | r34842 >
Date:23:42, 14 May 2008
Author:brion
Status:old
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -1002,6 +1002,13 @@
10031003 wfProfileIn( __METHOD__ );
10041004 wfDebug( __METHOD__.": checking...\n" );
10051005
 1006+ // Initialize data...
 1007+ // Otherwise something ends up stomping on $this->mBlockedby when
 1008+ // things get lazy-loaded later, causing false positive block hits
 1009+ // due to -1 !== 0. Probably session-related... Nothing should be
 1010+ // overwriting mBlockedby, surely?
 1011+ $this->load();
 1012+
10061013 $this->mBlockedby = 0;
10071014 $this->mHideName = 0;
10081015 $ip = wfGetIP();

Status & tagging log