On 9/9/07, werdna@svn.wikimedia.org werdna@svn.wikimedia.org wrote:
Revision: 25680 Author: werdna Date: 2007-09-09 08:11:58 +0000 (Sun, 09 Sep 2007)
Log Message:
- Allow userCan to take null $user - and replace it with $wgUser if passed.
. . .
First of all, why? We should be cutting down the use of $wgUser as much as possible, not adding it in extra places. The more methods that are free of any given global, the better. I'm not the only one who dreams fondly of elimination of things like $wgUser altogether. If someone forgets a function argument, they can get a fatal error and take two minutes to fix it.
Second of all, it doesn't even work, since you made the assignment after the global declaration. "Fatal error: Call to a member function isAllowed() on a non-object in /var/www/trunk/phase3/includes/Title.php on line 1187"
And while I was looking at why $wgUser was declared at all, I came across this, which I'm pretty sure is wrong:
$blockTimestamp = $wgLang->timeanddate( wfTimestamp( TS_MW, $wgUser->mBlock->mTimestamp ), true );
Every other reference in the block of code is to $user->mBlock, not $wgUser->mBlock.