Created
January 2, 2013 22:37
-
-
Save dereckson/4438948 to your computer and use it in GitHub Desktop.
Allows MediaWiki to force purge for anonymous requests, with ?action=purge&forcepurge=1. This is intended to be used when generating links webcrawlers shouldn't get.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/includes/actions/PurgeAction.php b/includes/actions/PurgeAction.php | |
index cd58889..5a8cc6f 100644 | |
--- a/includes/actions/PurgeAction.php | |
+++ b/includes/actions/PurgeAction.php | |
@@ -61,7 +61,8 @@ class PurgeAction extends FormAction { | |
// This will throw exceptions if there's a problem | |
$this->checkCanExecute( $this->getUser() ); | |
- if ( $this->getUser()->isAllowed( 'purge' ) ) { | |
+ $forcePurge = isset( $_GET['forcepurge'] ) && ( $_GET['forcepurge'] == 1 ); | |
+ if ( $forcePurge || $this->getUser()->isAllowed( 'purge' ) ) { | |
$this->redirectParams = wfArrayToCGI( array_diff_key( | |
$this->getRequest()->getQueryValues(), | |
array( 'title' => null, 'action' => null ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment