X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/mediawiki.git/blobdiff_plain/74c929b24b048c9f1e31e17db757ae4195cd7673..dc9cc5d707f5a612938cc9371614cc41c328fda2:/includes/api/ApiRollback.php diff --git a/includes/api/ApiRollback.php b/includes/api/ApiRollback.php index 653dca9e..0f0eae10 100644 --- a/includes/api/ApiRollback.php +++ b/includes/api/ApiRollback.php @@ -37,7 +37,6 @@ class ApiRollback extends ApiBase { } public function execute() { - $this->getMain()->requestWriteMode(); $params = $this->extractRequestParams(); $titleObj = NULL; @@ -68,15 +67,15 @@ class ApiRollback extends ApiBase { if($retval) // We don't care about multiple errors, just report one of them - $this->dieUsageMsg(current($retval)); + $this->dieUsageMsg(reset($retval)); $info = array( 'title' => $titleObj->getPrefixedText(), - 'pageid' => $details['current']->getPage(), + 'pageid' => intval($details['current']->getPage()), 'summary' => $details['summary'], - 'revid' => $titleObj->getLatestRevID(), - 'old_revid' => $details['current']->getID(), - 'last_revid' => $details['target']->getID() + 'revid' => intval($titleObj->getLatestRevID()), + 'old_revid' => intval($details['current']->getID()), + 'last_revid' => intval($details['target']->getID()) ); $this->getResult()->addValue(null, $this->getModuleName(), $info); @@ -84,6 +83,10 @@ class ApiRollback extends ApiBase { public function mustBePosted() { return true; } + public function isWriteMode() { + return true; + } + public function getAllowedParams() { return array ( 'title' => null, @@ -119,6 +122,6 @@ class ApiRollback extends ApiBase { } public function getVersion() { - return __CLASS__ . ': $Id: ApiRollback.php 45043 2008-12-26 04:13:47Z mrzman $'; + return __CLASS__ . ': $Id: ApiRollback.php 48122 2009-03-07 12:58:41Z catrope $'; } }