diff options
Diffstat (limited to 'includes/api/ApiUndelete.php')
-rw-r--r-- | includes/api/ApiUndelete.php | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/includes/api/ApiUndelete.php b/includes/api/ApiUndelete.php index c9962517..4bbe568d 100644 --- a/includes/api/ApiUndelete.php +++ b/includes/api/ApiUndelete.php @@ -29,10 +29,6 @@ */ class ApiUndelete extends ApiBase { - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { $params = $this->extractRequestParams(); @@ -45,7 +41,7 @@ class ApiUndelete extends ApiBase { } $titleObj = Title::newFromText( $params['title'] ); - if ( !$titleObj ) { + if ( !$titleObj || $titleObj->isExternal() ) { $this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) ); } @@ -61,7 +57,13 @@ class ApiUndelete extends ApiBase { } $pa = new PageArchive( $titleObj ); - $retval = $pa->undelete( ( isset( $params['timestamps'] ) ? $params['timestamps'] : array() ), $params['reason'] ); + $retval = $pa->undelete( + ( isset( $params['timestamps'] ) ? $params['timestamps'] : array() ), + $params['reason'], + array(), + false, + $this->getUser() + ); if ( !is_array( $retval ) ) { $this->dieUsageMsg( 'cannotundelete' ); } @@ -170,8 +172,4 @@ class ApiUndelete extends ApiBase { public function getHelpUrls() { return 'https://www.mediawiki.org/wiki/API:Undelete'; } - - public function getVersion() { - return __CLASS__ . ': $Id$'; - } } |