private $mUser = null;
public function execute() {
+ $this->useTransactionalTimeLimit();
+
$user = $this->getUser();
$params = $this->extractRequestParams();
$pageObj = WikiPage::factory( $titleObj );
$summary = $params['summary'];
$details = array();
+
+ // If change tagging was requested, check that the user is allowed to tag,
+ // and the tags are valid
+ if ( count( $params['tags'] ) ) {
+ $tagStatus = ChangeTags::canAddTagsAccompanyingChange( $params['tags'], $user );
+ if ( !$tagStatus->isOK() ) {
+ $this->dieStatus( $tagStatus );
+ }
+ }
+
$retval = $pageObj->doRollback(
$this->getRbUser( $params ),
$summary,
// Watch pages
$this->setWatch( $watch, $titleObj, 'watchrollback' );
+ if ( count( $params['tags'] ) ) {
+ ChangeTags::addTags( $params['tags'], null, intval( $details['newid'] ), null, null );
+ }
+
$info = array(
'title' => $titleObj->getPrefixedText(),
'pageid' => intval( $details['current']->getPage() ),
'pageid' => array(
ApiBase::PARAM_TYPE => 'integer'
),
+ 'tags' => array(
+ ApiBase::PARAM_TYPE => ChangeTags::listExplicitlyDefinedTags(),
+ ApiBase::PARAM_ISMULTI => true,
+ ),
'user' => array(
ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true
return $this->mTitleObj;
}
- public function getExamplesMessages() {
+ protected function getExamplesMessages() {
return array(
'action=rollback&title=Main%20Page&user=Example&token=123ABC' =>
'apihelp-rollback-example-simple',