r57480 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57479‎ | r57480 | r57481 >
Date:18:51, 7 October 2009
Author:aaron
Status:ok
Tags:
Comment:
Added more NS checks as needed
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -1809,8 +1809,11 @@
18101810 // Code stolen from Stabilization (which was stolen from ProtectionForm)
18111811 public static function onProtectionForm( $article, &$output ) {
18121812 global $wgUser, $wgRequest, $wgOut, $wgLang;
1813 - if( !count( FlaggedRevs::getProtectionLevels() ) )
 1813+ if( !count( FlaggedRevs::getProtectionLevels() ) ) {
18141814 return true; // nothing to do
 1815+ } else if( !FlaggedRevs::isPageReviewable( $article->getTitle() ) ) {
 1816+ return true; // not a reviewable page
 1817+ }
18151818 # Can the user actually do anything?
18161819 $isAllowed = $wgUser->isAllowed('stablesettings');
18171820 $disabledAttrib = !$isAllowed ? array( 'disabled' => 'disabled' ) : array();
@@ -1931,6 +1934,11 @@
19321935
19331936 // Add stability log extract to protection form
19341937 public static function insertStabilityLog( $article, $out ) {
 1938+ if( !count( FlaggedRevs::getProtectionLevels() ) ) {
 1939+ return true; // nothing to do
 1940+ } else if( !FlaggedRevs::isPageReviewable( $article->getTitle() ) ) {
 1941+ return true; // not a reviewable page
 1942+ }
19351943 # Show relevant lines from the stability log:
19361944 $out->addHTML( Xml::element( 'h2', null, LogPage::logName('stable') ) );
19371945 LogEventsList::showLogExtract( $out, 'stable', $article->getTitle()->getPrefixedText() );
@@ -1946,6 +1954,9 @@
19471955 if( wfReadOnly() || !$wgUser->isAllowed('stablesettings') ) {
19481956 return true; // user cannot change anything
19491957 }
 1958+ if( !FlaggedRevs::isPageReviewable( $article->getTitle() ) ) {
 1959+ return true; // not a reviewable page
 1960+ }
19501961 $form = new Stabilization();
19511962 $form->target = $article->getTitle(); # Our target page
19521963 $form->watchThis = null; // protection form already has a watch check

Follow-up revisions

RevisionCommit summaryAuthorDate
r57481merged r57480aaron18:52, 7 October 2009

Status & tagging log