]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - includes/api/ApiPatrol.php
MediaWiki 1.15.5
[autoinstallsdev/mediawiki.git] / includes / api / ApiPatrol.php
index 08de87b0fb84943802c60a352f4fa86b905e8f76..a6f25af29ebd18f1544d0c5125e94047900814c4 100644 (file)
@@ -42,7 +42,6 @@ class ApiPatrol extends ApiBase {
         */
        public function execute() {
                global $wgUser, $wgUseRCPatrol, $wgUseNPPatrol;
-               $this->getMain()->requestWriteMode();
                $params = $this->extractRequestParams();
                
                if(!isset($params['token']))
@@ -58,13 +57,17 @@ class ApiPatrol extends ApiBase {
                $retval = RecentChange::markPatrolled($params['rcid']);
                        
                if($retval)
-                       $this->dieUsageMsg(current($retval));
+                       $this->dieUsageMsg(reset($retval));
                
-               $result = array('rcid' => $rc->getAttribute('rc_id'));
+               $result = array('rcid' => intval($rc->getAttribute('rc_id')));
                ApiQueryBase::addTitleInfo($result, $rc->getTitle());
                $this->getResult()->addValue(null, $this->getModuleName(), $result);
        }
 
+       public function isWriteMode() {
+               return true;
+       }
+
        public function getAllowedParams() {
                return array (
                        'token' => null,
@@ -94,6 +97,6 @@ class ApiPatrol extends ApiBase {
        }
 
        public function getVersion() {
-               return __CLASS__ . ': $Id: ApiPatrol.php 42548 2008-10-25 14:04:43Z tstarling $';
+               return __CLASS__ . ': $Id: ApiPatrol.php 69579 2010-07-20 02:49:55Z tstarling $';
        }
 }