getRestrictions() always returns an array -- just use a standard boolean condition, not is_array().
Marked Title::getTitleProtection() private.
}
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'),
* @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;