testPngNativetZtxt requires zlib extension
[lhc/web/wiklou.git] / includes / SkinLegacy.php
index 7fb17a7..8642eca 100644 (file)
@@ -253,7 +253,7 @@ class LegacyTemplate extends BaseTemplate {
                $lang = $title->getPageLanguage();
                $variants = $lang->getVariants();
 
-               if ( !$wgDisableLangConversion && sizeof( $variants ) > 1
+               if ( !$wgDisableLangConversion && count( $variants ) > 1
                        && !$title->isSpecialPage() ) {
                        foreach ( $variants as $code ) {
                                $varname = $lang->getVariantname( $code );
@@ -345,7 +345,7 @@ class LegacyTemplate extends BaseTemplate {
                                        $s .= $this->deleteThisPage();
                                }
 
-                               if ( $wgUser->isAllowed( 'protect' ) ) {
+                               if ( $wgUser->isAllowed( 'protect' ) && $title->getRestrictionTypes() ) {
                                        $s .= $sep . $this->protectThisPage();
                                }
 
@@ -610,7 +610,7 @@ class LegacyTemplate extends BaseTemplate {
                $diff = $wgRequest->getVal( 'diff' );
                $title = $this->getSkin()->getTitle();
 
-               if ( $title->getArticleID() && ( ! $diff ) && $wgUser->isAllowed( 'protect' ) ) {
+               if ( $title->getArticleID() && ( ! $diff ) && $wgUser->isAllowed( 'protect' ) && $title->getRestrictionTypes() ) {
                        if ( $title->isProtected() ) {
                                $text = wfMessage( 'unprotectthispage' )->text();
                                $query = array( 'action' => 'unprotect' );