$wgUser is never a Stub since r70970.
authorPlatonides <platonides@users.mediawiki.org>
Sun, 17 Oct 2010 22:47:24 +0000 (22:47 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Sun, 17 Oct 2010 22:47:24 +0000 (22:47 +0000)
includes/GlobalFunctions.php
includes/Title.php

index a90c7dc..0bdc558 100644 (file)
@@ -499,7 +499,8 @@ function wfLogProfilingData() {
                $forward = "\t(proxied via {$_SERVER['REMOTE_ADDR']}{$forward})";
        }
        // Don't unstub $wgUser at this late stage just for statistics purposes
-       if( StubObject::isRealObject( $wgUser ) && $wgUser->isAnon() ) {
+       // FIXME: We can detect some anons even if it is not loaded. See User::getId()
+       if( $wgUser->mDataLoaded && $wgUser->isAnon() ) {
                $forward .= ' anon';
        }
        $log = sprintf( "%s\t%04.3f\t%s\n",
index 3dd12de..5e136fc 100644 (file)
@@ -1185,14 +1185,6 @@ class Title {
         * @return \type{\array} Array of arrays of the arguments to wfMsg to explain permissions problems.
         */
        public function getUserPermissionsErrors( $action, $user, $doExpensiveQueries = true, $ignoreErrors = array() ) {
-               if ( !StubObject::isRealObject( $user ) ) {
-                       // Since StubObject is always used on globals, we can
-                       // unstub $wgUser here and set $user = $wgUser
-                       global $wgUser;
-                       $wgUser->_unstub( '', 5 );
-                       $user = $wgUser;
-               }
-
                $errors = $this->getUserPermissionsErrorsInternal( $action, $user, $doExpensiveQueries );
 
                // Remove the errors being ignored.