r29572 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r29571‎ | r29572 | r29573 >
Date:04:55, 11 January 2008
Author:brion
Status:old
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -1255,7 +1255,7 @@
12561256 * @return mixed An associative array representing any existent title
12571257 * protection, or false if there's none.
12581258 */
1259 - public function getTitleProtection() {
 1259+ private function getTitleProtection() {
12601260 // Can't protect pages in special namespaces
12611261 if ( $this->getNamespace() < NS_MAIN ) {
12621262 return false;
Index: trunk/phase3/includes/SkinTemplate.php
@@ -765,7 +765,7 @@
766766 }
767767
768768 if ( $this->mTitle->getNamespace() !== NS_MEDIAWIKI && $wgUser->isAllowed( 'protect' ) ) {
769 - if( !is_array( $this->mTitle->getTitleProtection() ) ) {
 769+ if( !$this->mTitle->getRestrictions( 'create' ) ) {
770770 $content_actions['protect'] = array(
771771 'class' => ($action == 'protect') ? 'selected' : false,
772772 'text' => wfMsg('protect'),

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r29565Don't call getTitleProtection(). That is really just an internal function for...aaron23:13, 10 January 2008

Status & tagging log