Jackmcbarn has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/105629


Change subject: Add Special:Purge
......................................................................

Add Special:Purge

Add special page Special:Purge, which redirects Special:Purge/###
to ###?action=purge.

Bug: 59622
Change-Id: If532d06f600f22439912d20771907dfbe9354d1a
---
M includes/AutoLoader.php
M includes/SpecialPageFactory.php
A includes/specials/SpecialPurge.php
M languages/messages/MessagesEn.php
4 files changed, 45 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/29/105629/1

diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php
index a9b0376..0ad8d38 100644
--- a/includes/AutoLoader.php
+++ b/includes/AutoLoader.php
@@ -988,6 +988,7 @@
        'SpecialPrefixindex' => 'includes/specials/SpecialPrefixindex.php',
        'SpecialProtectedpages' => 
'includes/specials/SpecialProtectedpages.php',
        'SpecialProtectedtitles' => 
'includes/specials/SpecialProtectedtitles.php',
+       'SpecialPurge' => 'includes/specials/SpecialPurge.php',
        'SpecialRandomInCategory' => 
'includes/specials/SpecialRandomInCategory.php',
        'SpecialRandomredirect' => 
'includes/specials/SpecialRandomredirect.php',
        'SpecialRecentChanges' => 'includes/specials/SpecialRecentchanges.php',
diff --git a/includes/SpecialPageFactory.php b/includes/SpecialPageFactory.php
index 18b8f0b..e57c16e 100644
--- a/includes/SpecialPageFactory.php
+++ b/includes/SpecialPageFactory.php
@@ -163,6 +163,7 @@
                'Myuploads'                 => 'SpecialMyuploads',
                'AllMyUploads'              => 'SpecialAllMyUploads',
                'PermanentLink'             => 'SpecialPermanentLink',
+               'Purge'                     => 'SpecialPurge',
                'Redirect'                  => 'SpecialRedirect',
                'Revisiondelete'            => 'SpecialRevisionDelete',
                'Specialpages'              => 'SpecialSpecialpages',
diff --git a/includes/specials/SpecialPurge.php 
b/includes/specials/SpecialPurge.php
new file mode 100644
index 0000000..767c76d
--- /dev/null
+++ b/includes/specials/SpecialPurge.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Redirect from Special:Purge/### to ###?action=purge.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup SpecialPage
+ */
+
+/**
+ * Redirect from Special:Purge/### to ###?action=purge.
+ *
+ * @ingroup SpecialPage
+ */
+class SpecialPurge extends RedirectSpecialArticle {
+       function __construct() {
+               parent::__construct( 'Purge' );
+       }
+
+       function getRedirect( $page ) {
+               $title = Title::newFromText( $page );
+               if( $title instanceof Title ) {
+                       $this->mAddedRedirectParams['action'] = 'purge';
+                       return $title;
+               }
+               throw new ErrorPageError( 'nopagetitle', 'nopagetext' );
+       }
+}
diff --git a/languages/messages/MessagesEn.php 
b/languages/messages/MessagesEn.php
index 04d7ced..19142f9 100644
--- a/languages/messages/MessagesEn.php
+++ b/languages/messages/MessagesEn.php
@@ -450,6 +450,7 @@
        'Prefixindex'               => array( 'PrefixIndex' ) ,
        'Protectedpages'            => array( 'ProtectedPages' ),
        'Protectedtitles'           => array( 'ProtectedTitles' ),
+       'Purge'                     => array( 'Purge' ),
        'Randompage'                => array( 'Random', 'RandomPage' ),
        'RandomInCategory'          => array( 'RandomInCategory' ),
        'Randomredirect'            => array( 'RandomRedirect' ),

-- 
To view, visit https://gerrit.wikimedia.org/r/105629
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If532d06f600f22439912d20771907dfbe9354d1a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Jackmcbarn <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to