From 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 12 Aug 2013 09:28:15 +0200 Subject: Update to MediaWiki 1.21.1 --- includes/api/ApiFileRevert.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'includes/api/ApiFileRevert.php') diff --git a/includes/api/ApiFileRevert.php b/includes/api/ApiFileRevert.php index 83d078d2..cbb2ba6a 100644 --- a/includes/api/ApiFileRevert.php +++ b/includes/api/ApiFileRevert.php @@ -37,10 +37,6 @@ class ApiFileRevert extends ApiBase { protected $params; - public function __construct( $main, $action ) { - parent::__construct( $main, $action ); - } - public function execute() { $this->params = $this->extractRequestParams(); // Extract the file and archiveName from the request parameters @@ -50,7 +46,7 @@ class ApiFileRevert extends ApiBase { $this->checkPermissions( $this->getUser() ); $sourceUrl = $this->file->getArchiveVirtualUrl( $this->archiveName ); - $status = $this->file->upload( $sourceUrl, $this->params['comment'], $this->params['comment'] ); + $status = $this->file->upload( $sourceUrl, $this->params['comment'], $this->params['comment'], 0, false, false, $this->getUser() ); if ( $status->isGood() ) { $result = array( 'result' => 'Success' ); @@ -73,8 +69,8 @@ class ApiFileRevert extends ApiBase { protected function checkPermissions( $user ) { $title = $this->file->getTitle(); $permissionErrors = array_merge( - $title->getUserPermissionsErrors( 'edit' , $user ), - $title->getUserPermissionsErrors( 'upload' , $user ) + $title->getUserPermissionsErrors( 'edit', $user ), + $title->getUserPermissionsErrors( 'upload', $user ) ); if ( $permissionErrors ) { @@ -191,12 +187,8 @@ class ApiFileRevert extends ApiBase { public function getExamples() { return array( - 'api.php?action=filerevert&filename=Wiki.png&comment=Revert&archivename=20110305152740!Wiki.png&token=+\\' + 'api.php?action=filerevert&filename=Wiki.png&comment=Revert&archivename=20110305152740!Wiki.png&token=123ABC' => 'Revert Wiki.png to the version of 20110305152740', ); } - - public function getVersion() { - return __CLASS__ . ': $Id$'; - } } -- cgit v1.2.2