From b7ccc5aef84f29b25debb3598c388701605226dd Mon Sep 17 00:00:00 2001 From: Rob Church Date: Sat, 7 Jul 2007 04:53:35 +0000 Subject: [PATCH] * Coding conventions * Fix profiling breakage --- includes/Title.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index 37815eb678..15de495091 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1001,22 +1001,14 @@ class Title { * * @return boolean */ - public function isNamespaceProtected( ) { + public function isNamespaceProtected() { global $wgNamespaceProtection, $wgUser; - - $fname = 'Title::isNamespaceProtected'; - - if ( array_key_exists( $this->mNamespace, $wgNamespaceProtection ) ) { - $nsProt = $wgNamespaceProtection[ $this->mNamespace ]; - if ( !is_array($nsProt) ) $nsProt = array($nsProt); - foreach( $nsProt as $right ) { - if( '' != $right && !$wgUser->isAllowed( $right ) ) { - wfProfileOut( $fname ); + if( isset( $wgNamespaceProtection[ $this->mNamespace ] ) ) { + foreach( (array)$wgNamespaceProtection[ $this->mNamespace ] as $right ) { + if( $right != '' && !$wgUser->isAllowed( $right ) ) return true; - } } } - return false; } -- 2.20.1