From 7584a85307d4cb5709420f580bbde8b9992ff591 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 11 Jan 2008 04:55:48 +0000 Subject: [PATCH] Redo r29565, but as far as I see working now. :) getRestrictions() always returns an array -- just use a standard boolean condition, not is_array(). Marked Title::getTitleProtection() private. --- includes/SkinTemplate.php | 2 +- includes/Title.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 6c6b1ab188..9ba8030464 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -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'), diff --git a/includes/Title.php b/includes/Title.php index e0d55143e1..74090b7cbe 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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; -- 2.20.1