From: Rob Church Date: Sat, 7 Jul 2007 04:53:35 +0000 (+0000) Subject: * Coding conventions X-Git-Tag: 1.31.0-rc.0~52223 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=b7ccc5aef84f29b25debb3598c388701605226dd;p=lhc%2Fweb%2Fwiklou.git * Coding conventions * Fix profiling breakage --- 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; }