From 799e813a616ac30392ee6d6e4acc9518c553f9ff Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 20 Jul 2011 16:49:02 +0000 Subject: [PATCH] Make Title::isNamespaceProtected() require the $user parameter, the only call to it is in the file itself --- includes/Title.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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 ) ) { -- 2.20.1