* NS_SPECIAL should not have any applicable restriction type
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 5 Mar 2011 19:49:24 +0000 (19:49 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 5 Mar 2011 19:49:24 +0000 (19:49 +0000)
* Removed some trailing whitespaces

includes/Title.php

index be0dbd1..59a0803 100644 (file)
@@ -4136,6 +4136,10 @@ class Title {
         * @return array applicable restriction types
         */
        public function getRestrictionTypes() {
+               if ( $this->getNamespace() == NS_SPECIAL ) {
+                       return array();
+               }
+
                $types = self::getFilteredRestrictionTypes( $this->exists() );
 
                if ( $this->getNamespace() != NS_FILE ) {
@@ -4162,7 +4166,7 @@ class Title {
                $types = $wgRestrictionTypes;
                if ( $exists ) {
                        # Remove the create restriction for existing titles
-                       $types = array_diff( $types, array( 'create' ) );                       
+                       $types = array_diff( $types, array( 'create' ) );
                } else {
                        # Only the create and upload restrictions apply to non-existing titles
                        $types = array_intersect( $types, array( 'create', 'upload' ) );