
aaron at svn
Nov 16, 2009, 5:52 PM
Post #1 of 1
(86 views)
Permalink
|
|
SVN: [59166] trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
|
|
http://www.mediawiki.org/wiki/Special:Code/MediaWiki/59166 Revision: 59166 Author: aaron Date: 2009-11-17 01:52:43 +0000 (Tue, 17 Nov 2009) Log Message: ----------- bug 21528 Added missing article existence check for protect UI Modified Paths: -------------- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php Modified: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php =================================================================== --- trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-11-17 01:18:24 UTC (rev 59165) +++ trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php 2009-11-17 01:52:43 UTC (rev 59166) @@ -1827,7 +1827,7 @@ // Code stolen from Stabilization (which was stolen from ProtectionForm) public static function onProtectionForm( $article, &$output ) { global $wgUser, $wgRequest, $wgOut, $wgLang; - if( !FlaggedRevs::useProtectionLevels() ) { + if( !FlaggedRevs::useProtectionLevels() || !$article->exists() ) { return true; // nothing to do } else if( !FlaggedRevs::isPageReviewable( $article->getTitle() ) ) { return true; // not a reviewable page @@ -1955,7 +1955,7 @@ // Add stability log extract to protection form public static function insertStabilityLog( $article, $out ) { - if( !FlaggedRevs::useProtectionLevels() ) { + if( !FlaggedRevs::useProtectionLevels() || !$article->exists() ) { return true; // nothing to do } else if( !FlaggedRevs::isPageReviewable( $article->getTitle() ) ) { return true; // not a reviewable page @@ -1970,7 +1970,7 @@ public static function onProtectionSave( $article, &$errorMsg ) { global $wgUser, $wgRequest; $levels = FlaggedRevs::getProtectionLevels(); - if( empty($levels) ) + if( empty($levels) || !$article->exists() ) return true; // simple custom levels set for action=protect if( wfReadOnly() || !$wgUser->isAllowed('stablesettings') ) { return true; // user cannot change anything _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS [at] lists https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs
|