From f8a8ad8dcd9b2c3e21bf4e02d62fb7de04870ba7 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 27 Aug 2007 19:37:52 +0000 Subject: [PATCH] *Don't reference $moverestr either, makes things more complicated --- includes/Article.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 40b85d5f09..6c02ec6781 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -742,8 +742,7 @@ class Article { if ( $this->mTitle->isProtected() ) { $editrestr = $this->mTitle->getRestrictions('edit'); - $moverestr = $this->mTitle->getRestrictions('move'); - $this->addProtectionNotice( $editrestr, $moverestr ); + $this->addProtectionNotice( $editrestr ); } $outputDone = false; @@ -897,23 +896,27 @@ class Article { * restrictions. Cares only about the first permission in the arrays, which is * part of a larger shitty inconsistency about requiring several permissions... * @param Array $editrestr, edit restrictions - * @param Array $moverestr, move restrictions */ - function addProtectionNotice( $editrestr, $moverestr ) { + function addProtectionNotice( $editrestr ) { global $wgOut; + + if( empty($editrestr) ) + return; + + $permission = $editrestr[0]; + $permission = ($permission=='sysop') ? 'protect' : $permission; $editGroups = ''; # Get groups that have each right - if( !empty( $editrestr ) ) { - $permission = ($editrestr[0]=='sysop') ? 'protect' : $editrestr[0]; + if( $permission ) { $editGroups = $wgOut->getGroupsWithPermission( $permission ); $editGroups = implode( ', ', $editGroups ); } # Use general messages if no groups found for a type if( !$editGroups ) { - $msg = wfMsgExt( 'protected-subtitle', array('parsemag') ); + $msg = wfMsgExt( 'protected-subtitle', array('parsemag'), $editrestr ); } else { - $msg = wfMsgExt( 'protected-subtitle-edit', array('parsemag'), $editGroups, $editrestr, $moverestr ); + $msg = wfMsgExt( 'protected-subtitle-edit', array('parsemag'), $editGroups, $editrestr ); } if( $wgOut->getSubtitle() ) $msg = " $msg"; -- 2.20.1