* IPBlockForm - Use SpecialBlock directly
* WatchlistEditor - Use SpecialEditWatchlist directly
* FormatExif - Use FormatMetadata directly
+* RevertFileAction - Use RevertAction directly
== Compatibility ==
'RawPage' => 'includes/actions/RawAction.php',
'RenderAction' => 'includes/actions/RenderAction.php',
'RevertAction' => 'includes/actions/RevertAction.php',
- 'RevertFileAction' => 'includes/actions/RevertAction.php',
'RevisiondeleteAction' => 'includes/actions/RevisiondeleteAction.php',
'RollbackAction' => 'includes/actions/RollbackAction.php',
'SubmitAction' => 'includes/actions/EditAction.php',
*/
/**
- * Dummy class for pages not in NS_FILE
- *
- * @ingroup Actions
- */
-class RevertAction extends Action {
-
- public function getName() {
- return 'revert';
- }
-
- public function show() {
- $this->getOutput()->showErrorPage( 'nosuchaction', 'nosuchactiontext' );
- }
-
- public function execute() {
- }
-}
-
-/**
- * Class for pages in NS_FILE
+ * File reversion user interface
*
* @ingroup Actions
*/
-class RevertFileAction extends FormAction {
+class RevertAction extends FormAction {
/**
* @var OldLocalFile
*/
}
protected function checkCanExecute( User $user ) {
+ if ( $this->getTitle()->getNamespace() !== NS_FILE ) {
+ throw new ErrorPageError( $this->msg( 'nosuchaction' ), $this->msg( 'nosuchactiontext' ) );
+ }
parent::checkCanExecute( $user );
$oldimage = $this->getRequest()->getText( 'oldimage' );