Index: trunk/phase3/includes/Title.php |
— | — | @@ -1001,22 +1001,14 @@ |
1002 | 1002 | * |
1003 | 1003 | * @return boolean |
1004 | 1004 | */ |
1005 | | - public function isNamespaceProtected( ) { |
| 1005 | + public function isNamespaceProtected() { |
1006 | 1006 | global $wgNamespaceProtection, $wgUser; |
1007 | | - |
1008 | | - $fname = 'Title::isNamespaceProtected'; |
1009 | | - |
1010 | | - if ( array_key_exists( $this->mNamespace, $wgNamespaceProtection ) ) { |
1011 | | - $nsProt = $wgNamespaceProtection[ $this->mNamespace ]; |
1012 | | - if ( !is_array($nsProt) ) $nsProt = array($nsProt); |
1013 | | - foreach( $nsProt as $right ) { |
1014 | | - if( '' != $right && !$wgUser->isAllowed( $right ) ) { |
1015 | | - wfProfileOut( $fname ); |
| 1007 | + if( isset( $wgNamespaceProtection[ $this->mNamespace ] ) ) { |
| 1008 | + foreach( (array)$wgNamespaceProtection[ $this->mNamespace ] as $right ) { |
| 1009 | + if( $right != '' && !$wgUser->isAllowed( $right ) ) |
1016 | 1010 | return true; |
1017 | | - } |
1018 | 1011 | } |
1019 | 1012 | } |
1020 | | - |
1021 | 1013 | return false; |
1022 | 1014 | } |
1023 | 1015 | |