Merge "Remove m prefixes from private variables"
[lhc/web/wiklou.git] / includes / api / ApiFileRevert.php
index 91ab499..dc5e24e 100644 (file)
@@ -46,7 +46,15 @@ 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'], 0, false, false, $this->getUser() );
+               $status = $this->file->upload(
+                       $sourceUrl,
+                       $this->params['comment'],
+                       $this->params['comment'],
+                       0,
+                       false,
+                       false,
+                       $this->getUser()
+               );
 
                if ( $status->isGood() ) {
                        $result = array( 'result' => 'Success' );
@@ -58,7 +66,6 @@ class ApiFileRevert extends ApiBase {
                }
 
                $this->getResult()->addValue( null, $this->getModuleName(), $result );
-
        }
 
        /**
@@ -69,8 +76,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 ) {
@@ -130,7 +137,6 @@ class ApiFileRevert extends ApiBase {
                                ApiBase::PARAM_REQUIRED => true
                        ),
                );
-
        }
 
        public function getParamDescription() {
@@ -187,7 +193,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',
                );
        }