r74934 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74933‎ | r74934 | r74935 >
Date:22:47, 17 October 2010
Author:platonides
Status:ok
Tags:
Comment:
$wgUser is never a Stub since r70970.
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -499,7 +499,8 @@
500500 $forward = "\t(proxied via {$_SERVER['REMOTE_ADDR']}{$forward})";
501501 }
502502 // Don't unstub $wgUser at this late stage just for statistics purposes
503 - if( StubObject::isRealObject( $wgUser ) && $wgUser->isAnon() ) {
 503+ // FIXME: We can detect some anons even if it is not loaded. See User::getId()
 504+ if( $wgUser->mDataLoaded && $wgUser->isAnon() ) {
504505 $forward .= ' anon';
505506 }
506507 $log = sprintf( "%s\t%04.3f\t%s\n",
Index: trunk/phase3/includes/Title.php
@@ -1185,14 +1185,6 @@
11861186 * @return \type{\array} Array of arrays of the arguments to wfMsg to explain permissions problems.
11871187 */
11881188 public function getUserPermissionsErrors( $action, $user, $doExpensiveQueries = true, $ignoreErrors = array() ) {
1189 - if ( !StubObject::isRealObject( $user ) ) {
1190 - // Since StubObject is always used on globals, we can
1191 - // unstub $wgUser here and set $user = $wgUser
1192 - global $wgUser;
1193 - $wgUser->_unstub( '', 5 );
1194 - $user = $wgUser;
1195 - }
1196 -
11971189 $errors = $this->getUserPermissionsErrorsInternal( $action, $user, $doExpensiveQueries );
11981190
11991191 // Remove the errors being ignored.

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70970Get rid of StubUser. Constructing a user object isn't quite as intensive as i...demon17:10, 12 August 2010

Status & tagging log