-
- if(!isset($params['token']))
- $this->dieUsageMsg(array('missingparam', 'token'));
- if(!isset($params['rcid']))
- $this->dieUsageMsg(array('missingparam', 'rcid'));
- if(!$wgUser->matchEditToken($params['token']))
- $this->dieUsageMsg(array('sessionfailure'));
-
- $rc = RecentChange::newFromID($params['rcid']);
- if(!$rc instanceof RecentChange)
- $this->dieUsageMsg(array('nosuchrcid', $params['rcid']));
- $retval = RecentChange::markPatrolled($params['rcid']);
-
- if($retval)
- $this->dieUsageMsg(reset($retval));
-
- $result = array('rcid' => intval($rc->getAttribute('rc_id')));
- ApiQueryBase::addTitleInfo($result, $rc->getTitle());
- $this->getResult()->addValue(null, $this->getModuleName(), $result);
+
+ $rc = RecentChange::newFromID( $params['rcid'] );
+ if ( !$rc instanceof RecentChange ) {
+ $this->dieUsageMsg( array( 'nosuchrcid', $params['rcid'] ) );
+ }
+ $retval = RecentChange::markPatrolled( $params['rcid'] );
+
+ if ( $retval ) {
+ $this->dieUsageMsg( reset( $retval ) );
+ }
+
+ $result = array( 'rcid' => intval( $rc->getAttribute( 'rc_id' ) ) );
+ ApiQueryBase::addTitleInfo( $result, $rc->getTitle() );
+ $this->getResult()->addValue( null, $this->getModuleName(), $result );
+ }
+
+ public function mustBePosted() {
+ return true;