Make Title::isNamespaceProtected() require the $user parameter, the only call to...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 20 Jul 2011 16:49:02 +0000 (16:49 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 20 Jul 2011 16:49:02 +0000 (16:49 +0000)
includes/Title.php

index d078bb5..fc80861 100644 (file)
@@ -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 ) ) {