r57474 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57473‎ | r57474 | r57475 >
Date:18:27, 7 October 2009
Author:aaron
Status:ok
Tags:
Comment:
Protection hook should do nothing unless custom "protection levels" are populated. Check was on the UI hook but missing from onProtectionForm().
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -1940,6 +1940,9 @@
19411941 // Update stability config from request
19421942 public static function onProtectionSave( $article, &$errorMsg ) {
19431943 global $wgUser, $wgRequest;
 1944+ $levels = FlaggedRevs::getProtectionLevels();
 1945+ if( empty($levels) )
 1946+ return true; // simple custom levels set for action=protect
19441947 if( wfReadOnly() || !$wgUser->isAllowed('stablesettings') ) {
19451948 return true; // user cannot change anything
19461949 }
@@ -1953,7 +1956,6 @@
19541957 $form->expirySelection = $wgRequest->getVal( 'wpExpirySelection' ); # Expiry dropdown
19551958 # Fill in config from the protection level...
19561959 $selected = $wgRequest->getVal( 'wpStabilityConfig' );
1957 - $levels = FlaggedRevs::getProtectionLevels();
19581960 if( $selected == "none" ) {
19591961 $form->select = FlaggedRevs::getPrecedence(); // default
19601962 $form->override = FlaggedRevs::showStableByDefault(); // default

Follow-up revisions

RevisionCommit summaryAuthorDate
r57475merged r57474aaron18:30, 7 October 2009

Status & tagging log