$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",
* @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.