From: Alexandre Emsenhuber Date: Wed, 20 Jul 2011 16:49:02 +0000 (+0000) Subject: Make Title::isNamespaceProtected() require the $user parameter, the only call to... X-Git-Tag: 1.31.0-rc.0~28717 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=799e813a616ac30392ee6d6e4acc9518c553f9ff;p=lhc%2Fweb%2Fwiklou.git Make Title::isNamespaceProtected() require the $user parameter, the only call to it is in the file itself --- diff --git a/includes/Title.php b/includes/Title.php index d078bb5273..fc80861524 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1167,17 +1167,12 @@ class Title { * Determines if $user is unable to edit this page because it has been protected * by $wgNamespaceProtection. * - * @param $user User object, $wgUser will be used if not passed + * @param $user User object to check permissions * @return Bool */ - public function isNamespaceProtected( User $user = null ) { + public function isNamespaceProtected( User $user ) { global $wgNamespaceProtection; - if ( $user === null ) { - global $wgUser; - $user = $wgUser; - } - if ( isset( $wgNamespaceProtection[$this->mNamespace] ) ) { foreach ( (array)$wgNamespaceProtection[$this->mNamespace] as $right ) { if ( $right != '' && !$user->isAllowed( $right ) ) {