X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiFileRevert.php;h=02147fa3e8b4357958a1071b5379e74e498caf74;hb=30cc068774d9de3af900af70d00126f9be721773;hp=fab8b5a9c4ff6eb606d8dadad1eecd7ea40508e5;hpb=280cb03b4d87e864a723686daf5d1699b3566ec1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiFileRevert.php b/includes/api/ApiFileRevert.php index fab8b5a9c4..02147fa3e8 100644 --- a/includes/api/ApiFileRevert.php +++ b/includes/api/ApiFileRevert.php @@ -132,70 +132,18 @@ class ApiFileRevert extends ApiBase { ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_REQUIRED => true, ), - 'token' => array( - ApiBase::PARAM_TYPE => 'string', - ApiBase::PARAM_REQUIRED => true - ), - ); - } - - public function getParamDescription() { - return array( - 'filename' => 'Target filename without the File: prefix', - 'token' => 'Edit token. You can get one of these through prop=info', - 'comment' => 'Upload comment', - 'archivename' => 'Archive name of the revision to revert to', - ); - } - - public function getResultProperties() { - return array( - '' => array( - 'result' => array( - ApiBase::PROP_TYPE => array( - 'Success', - 'Failure' - ) - ), - 'errors' => array( - ApiBase::PROP_TYPE => 'string', - ApiBase::PROP_NULLABLE => true - ) - ) - ); - } - - public function getDescription() { - return array( - 'Revert a file to an old version.' - ); - } - - public function getPossibleErrors() { - return array_merge( parent::getPossibleErrors(), - array( - array( 'mustbeloggedin', 'upload' ), - array( 'badaccess-groups' ), - array( 'invalidtitle', 'title' ), - array( 'notanarticle' ), - array( 'filerevert-badversion' ), - ) ); } public function needsToken() { - return true; - } - - public function getTokenSalt() { - return ''; + return 'csrf'; } - public function getExamples() { + public function getExamplesMessages() { return array( - 'api.php?action=filerevert&filename=Wiki.png&comment=Revert&' . + 'action=filerevert&filename=Wiki.png&comment=Revert&' . 'archivename=20110305152740!Wiki.png&token=123ABC' - => 'Revert Wiki.png to the version of 20110305152740', + => 'apihelp-filerevert-example-revert', ); } }