From f6d65e533c62f6deb21342d4901ece24497b433e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 4 Jun 2015 07:31:04 +0200 Subject: Update to MediaWiki 1.25.1 --- includes/actions/SpecialPageAction.php | 79 ++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 includes/actions/SpecialPageAction.php (limited to 'includes/actions/SpecialPageAction.php') diff --git a/includes/actions/SpecialPageAction.php b/includes/actions/SpecialPageAction.php new file mode 100644 index 00000000..9b721634 --- /dev/null +++ b/includes/actions/SpecialPageAction.php @@ -0,0 +1,79 @@ + 'Revisiondelete', + 'editchangetags' => 'EditTags', + ); + + public function getName() { + $request = $this->getRequest(); + $actionName = $request->getVal( 'action', 'view' ); + // TODO: Shouldn't need to copy-paste this code from Action::getActionName! + if ( $actionName === 'historysubmit' ) { + if ( $request->getBool( 'revisiondelete' ) ) { + $actionName = 'revisiondelete'; + } elseif ( $request->getBool( 'editchangetags' ) ) { + $actionName = 'editchangetags'; + } + } + + if ( isset( self::$actionToSpecialPageMapping[$actionName] ) ) { + return $actionName; + } + return 'nosuchaction'; + } + + public function requiresUnblock() { + return false; + } + + public function getDescription() { + return ''; + } + + public function onView() { + return ''; + } + + public function show() { + $action = self::getName(); + if ( $action === 'nosuchaction' ) { + throw new ErrorPageError( $this->msg( 'nosuchaction' ), $this->msg( 'nosuchactiontext' ) ); + } + + // map actions to (whitelisted) special pages + $special = SpecialPageFactory::getPage( self::$actionToSpecialPageMapping[$action] ); + $special->setContext( $this->getContext() ); + $special->getContext()->setTitle( $special->getPageTitle() ); + $special->run( '' ); + } +} -- cgit v1.2.2