From d09f081aa2c56417dff0c9d78f7853e9be0bde97 Mon Sep 17 00:00:00 2001 From: Platonides Date: Sun, 17 Oct 2010 22:47:24 +0000 Subject: [PATCH] $wgUser is never a Stub since r70970. --- includes/GlobalFunctions.php | 3 ++- includes/Title.php | 8 -------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index a90c7dc9e6..0bdc558314 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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", diff --git a/includes/Title.php b/includes/Title.php index 3dd12de8b9..5e136fc263 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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. -- 2.20.1