From: Victor Vasiliev Date: Thu, 5 Jun 2008 14:05:35 +0000 (+0000) Subject: Fix some weird bugs on "you are blocked" form by unstubbing User object. X-Git-Tag: 1.31.0-rc.0~47152 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=0a7baed79ede1fa1c90057c7ebde41c99e7e4858;p=lhc%2Fweb%2Fwiklou.git Fix some weird bugs on "you are blocked" form by unstubbing User object. --- diff --git a/includes/Title.php b/includes/Title.php index 4ffcd981c5..49c0780e7e 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1052,6 +1052,12 @@ class Title { * @return array Array of arrays of the arguments to wfMsg to explain permissions problems. */ public function getUserPermissionsErrors( $action, $user, $doExpensiveQueries = true ) { + 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 ); global $wgContLang;