Redo r29565, but as far as I see working now. :)
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 11 Jan 2008 04:55:48 +0000 (04:55 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 11 Jan 2008 04:55:48 +0000 (04:55 +0000)
getRestrictions() always returns an array -- just use a standard boolean condition, not is_array().
Marked Title::getTitleProtection() private.

includes/SkinTemplate.php
includes/Title.php

index 6c6b1ab..9ba8030 100644 (file)
@@ -765,7 +765,7 @@ class SkinTemplate extends Skin {
                                }
 
                                if ( $this->mTitle->getNamespace() !== NS_MEDIAWIKI && $wgUser->isAllowed( 'protect' ) ) {
-                                       if( !is_array( $this->mTitle->getTitleProtection() ) ) {
+                                       if( !$this->mTitle->getRestrictions( 'create' ) ) {
                                                $content_actions['protect'] = array(
                                                        'class' => ($action == 'protect') ? 'selected' : false,
                                                        'text' => wfMsg('protect'),
index e0d5514..74090b7 100644 (file)
@@ -1255,7 +1255,7 @@ class Title {
         * @return mixed An associative array representing any existent title
         *   protection, or false if there's none.
         */
-       public function getTitleProtection() {
+       private function getTitleProtection() {
                // Can't protect pages in special namespaces
                if ( $this->getNamespace() < NS_MAIN ) {
                        return false;