merge latest master.
[lhc/web/wiklou.git] / includes / api / ApiEditPage.php
1 <?php
2 /**
3 *
4 *
5 * Created on August 16, 2007
6 *
7 * Copyright © 2007 Iker Labarga "<Firstname><Lastname>@gmail.com"
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 * http://www.gnu.org/copyleft/gpl.html
23 *
24 * @file
25 */
26
27 /**
28 * A module that allows for editing and creating pages.
29 *
30 * Currently, this wraps around the EditPage class in an ugly way,
31 * EditPage.php should be rewritten to provide a cleaner interface
32 * @ingroup API
33 */
34 class ApiEditPage extends ApiBase {
35
36 public function __construct( $query, $moduleName ) {
37 parent::__construct( $query, $moduleName );
38 }
39
40 public function execute() {
41 $user = $this->getUser();
42 $params = $this->extractRequestParams();
43
44 if ( is_null( $params['text'] ) && is_null( $params['appendtext'] ) &&
45 is_null( $params['prependtext'] ) &&
46 $params['undo'] == 0 )
47 {
48 $this->dieUsageMsg( 'missingtext' );
49 }
50
51 $pageObj = $this->getTitleOrPageId( $params );
52 $titleObj = $pageObj->getTitle();
53 if ( $titleObj->isExternal() ) {
54 $this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) );
55 }
56
57 if ( !isset( $params['contentmodel'] ) || $params['contentmodel'] == '' ) {
58 $contentHandler = $pageObj->getContentHandler();
59 } else {
60 $contentHandler = ContentHandler::getForModelID( $params['contentmodel'] );
61 }
62
63 // @todo ask handler whether direct editing is supported at all! make allowFlatEdit() method or some such
64
65 if ( !isset( $params['contentformat'] ) || $params['contentformat'] == '' ) {
66 $params['contentformat'] = $contentHandler->getDefaultFormat();
67 }
68
69 $contentFormat = $params['contentformat'];
70
71 if ( !$contentHandler->isSupportedFormat( $contentFormat ) ) {
72 $name = $titleObj->getPrefixedDBkey();
73 $model = $contentHandler->getModelID();
74
75 $this->dieUsage( "The requested format $contentFormat is not supported for content model ".
76 " $model used by $name", 'badformat' );
77 }
78
79 $apiResult = $this->getResult();
80
81 if ( $params['redirect'] ) {
82 if ( $titleObj->isRedirect() ) {
83 $oldTitle = $titleObj;
84
85 $titles = Revision::newFromTitle( $oldTitle, false, Revision::READ_LATEST )
86 ->getContent( Revision::FOR_THIS_USER )
87 ->getRedirectChain();
88 // array_shift( $titles );
89
90 $redirValues = array();
91 foreach ( $titles as $id => $newTitle ) {
92
93 if ( !isset( $titles[ $id - 1 ] ) ) {
94 $titles[ $id - 1 ] = $oldTitle;
95 }
96
97 $redirValues[] = array(
98 'from' => $titles[ $id - 1 ]->getPrefixedText(),
99 'to' => $newTitle->getPrefixedText()
100 );
101
102 $titleObj = $newTitle;
103 }
104
105 $apiResult->setIndexedTagName( $redirValues, 'r' );
106 $apiResult->addValue( null, 'redirects', $redirValues );
107 }
108 }
109
110 if ( $params['createonly'] && $titleObj->exists() ) {
111 $this->dieUsageMsg( 'createonly-exists' );
112 }
113 if ( $params['nocreate'] && !$titleObj->exists() ) {
114 $this->dieUsageMsg( 'nocreate-missing' );
115 }
116
117 // Now let's check whether we're even allowed to do this
118 $errors = $titleObj->getUserPermissionsErrors( 'edit', $user );
119 if ( !$titleObj->exists() ) {
120 $errors = array_merge( $errors, $titleObj->getUserPermissionsErrors( 'create', $user ) );
121 }
122 if ( count( $errors ) ) {
123 $this->dieUsageMsg( $errors[0] );
124 }
125
126 $toMD5 = $params['text'];
127 if ( !is_null( $params['appendtext'] ) || !is_null( $params['prependtext'] ) )
128 {
129 $content = $pageObj->getContent();
130
131 if ( !( $content instanceof TextContent ) ) {
132 // @todo: ContentHandler should have an isFlat() method or some such
133 // @todo: XXX: or perhaps there should be Content::append(), Content::prepend()
134 // @todo: ...and Content::supportsConcatenation()
135 $mode = $contentHandler->getModelID();
136 $this->dieUsage( "Can't append to pages using content model $mode", 'appendnotsupported' );
137 }
138
139 if ( !$content ) {
140 # If this is a MediaWiki:x message, then load the messages
141 # and return the message value for x.
142 if ( $titleObj->getNamespace() == NS_MEDIAWIKI ) {
143 $text = $titleObj->getDefaultMessageText();
144 if ( $text === false ) {
145 $text = '';
146 }
147
148 try {
149 $content = ContentHandler::makeContent( $text, $this->getTitle() );
150 } catch ( MWContentSerializationException $ex ) {
151 $this->dieUsage( $ex->getMessage(), 'parseerror' );
152 return;
153 }
154 }
155 }
156
157 if ( !is_null( $params['section'] ) ) {
158 if ( !$contentHandler->supportsSections() ) {
159 $modelName = $contentHandler->getModelID();
160 $this->dieUsage( "Sections are not supported for this content model: $modelName.", 'sectionsnotsupported' );
161 }
162
163 // Process the content for section edits
164 $section = intval( $params['section'] );
165 $content = $content->getSection( $section );
166
167 if ( !$content ) {
168 $this->dieUsage( "There is no section {$section}.", 'nosuchsection' );
169 }
170 }
171
172 if ( !$content ) {
173 $text = '';
174 } else {
175 $text = $content->serialize( $contentFormat );
176 }
177
178 $params['text'] = $params['prependtext'] . $text . $params['appendtext'];
179 $toMD5 = $params['prependtext'] . $params['appendtext'];
180 }
181
182 if ( $params['undo'] > 0 ) {
183 if ( $params['undoafter'] > 0 ) {
184 if ( $params['undo'] < $params['undoafter'] ) {
185 list( $params['undo'], $params['undoafter'] ) =
186 array( $params['undoafter'], $params['undo'] );
187 }
188 $undoafterRev = Revision::newFromID( $params['undoafter'] );
189 }
190 $undoRev = Revision::newFromID( $params['undo'] );
191 if ( is_null( $undoRev ) || $undoRev->isDeleted( Revision::DELETED_TEXT ) ) {
192 $this->dieUsageMsg( array( 'nosuchrevid', $params['undo'] ) );
193 }
194
195 if ( $params['undoafter'] == 0 ) {
196 $undoafterRev = $undoRev->getPrevious();
197 }
198 if ( is_null( $undoafterRev ) || $undoafterRev->isDeleted( Revision::DELETED_TEXT ) ) {
199 $this->dieUsageMsg( array( 'nosuchrevid', $params['undoafter'] ) );
200 }
201
202 if ( $undoRev->getPage() != $pageObj->getID() ) {
203 $this->dieUsageMsg( array( 'revwrongpage', $undoRev->getID(), $titleObj->getPrefixedText() ) );
204 }
205 if ( $undoafterRev->getPage() != $pageObj->getID() ) {
206 $this->dieUsageMsg( array( 'revwrongpage', $undoafterRev->getID(), $titleObj->getPrefixedText() ) );
207 }
208
209 $newContent = $contentHandler->getUndoContent( $pageObj->getRevision(), $undoRev, $undoafterRev );
210
211 if ( !$newContent ) {
212 $this->dieUsageMsg( 'undo-failure' );
213 }
214
215 $params['text'] = $newContent->serialize( $params['contentformat'] );
216
217 // If no summary was given and we only undid one rev,
218 // use an autosummary
219 if ( is_null( $params['summary'] ) && $titleObj->getNextRevisionID( $undoafterRev->getID() ) == $params['undo'] ) {
220 $params['summary'] = wfMessage( 'undo-summary', $params['undo'], $undoRev->getUserText() )->inContentLanguage()->text();
221 }
222 }
223
224 // See if the MD5 hash checks out
225 if ( !is_null( $params['md5'] ) && md5( $toMD5 ) !== $params['md5'] ) {
226 $this->dieUsageMsg( 'hashcheckfailed' );
227 }
228
229 // EditPage wants to parse its stuff from a WebRequest
230 // That interface kind of sucks, but it's workable
231 $requestArray = array(
232 'wpTextbox1' => $params['text'],
233 'format' => $contentFormat,
234 'model' => $contentHandler->getModelID(),
235 'wpEditToken' => $params['token'],
236 'wpIgnoreBlankSummary' => ''
237 );
238
239 if ( !is_null( $params['summary'] ) ) {
240 $requestArray['wpSummary'] = $params['summary'];
241 }
242
243 if ( !is_null( $params['sectiontitle'] ) ) {
244 $requestArray['wpSectionTitle'] = $params['sectiontitle'];
245 }
246
247 // Watch out for basetimestamp == ''
248 // wfTimestamp() treats it as NOW, almost certainly causing an edit conflict
249 if ( !is_null( $params['basetimestamp'] ) && $params['basetimestamp'] != '' ) {
250 $requestArray['wpEdittime'] = wfTimestamp( TS_MW, $params['basetimestamp'] );
251 } else {
252 $requestArray['wpEdittime'] = $pageObj->getTimestamp();
253 }
254
255 if ( !is_null( $params['starttimestamp'] ) && $params['starttimestamp'] != '' ) {
256 $requestArray['wpStarttime'] = wfTimestamp( TS_MW, $params['starttimestamp'] );
257 } else {
258 $requestArray['wpStarttime'] = wfTimestampNow(); // Fake wpStartime
259 }
260
261 if ( $params['minor'] || ( !$params['notminor'] && $user->getOption( 'minordefault' ) ) ) {
262 $requestArray['wpMinoredit'] = '';
263 }
264
265 if ( $params['recreate'] ) {
266 $requestArray['wpRecreate'] = '';
267 }
268
269 if ( !is_null( $params['section'] ) ) {
270 $section = intval( $params['section'] );
271 if ( $section == 0 && $params['section'] != '0' && $params['section'] != 'new' ) {
272 $this->dieUsage( "The section parameter must be set to an integer or 'new'", "invalidsection" );
273 }
274 $requestArray['wpSection'] = $params['section'];
275 } else {
276 $requestArray['wpSection'] = '';
277 }
278
279 $watch = $this->getWatchlistValue( $params['watchlist'], $titleObj );
280
281 // Deprecated parameters
282 if ( $params['watch'] ) {
283 $watch = true;
284 } elseif ( $params['unwatch'] ) {
285 $watch = false;
286 }
287
288 if ( $watch ) {
289 $requestArray['wpWatchthis'] = '';
290 }
291
292 global $wgTitle, $wgRequest;
293
294 $req = new DerivativeRequest( $this->getRequest(), $requestArray, true );
295
296 // Some functions depend on $wgTitle == $ep->mTitle
297 // TODO: Make them not or check if they still do
298 $wgTitle = $titleObj;
299
300 $articleObject = new Article( $titleObj );
301 $ep = new EditPage( $articleObject );
302
303 $ep->setContextTitle( $titleObj );
304 $ep->importFormData( $req );
305
306 // Run hooks
307 // Handle APIEditBeforeSave parameters
308 $r = array();
309 if ( !wfRunHooks( 'APIEditBeforeSave', array( $ep, $ep->textbox1, &$r ) ) ) {
310 if ( count( $r ) ) {
311 $r['result'] = 'Failure';
312 $apiResult->addValue( null, $this->getModuleName(), $r );
313 return;
314 } else {
315 $this->dieUsageMsg( 'hookaborted' );
316 }
317 }
318
319 // Do the actual save
320 $oldRevId = $articleObject->getRevIdFetched();
321 $result = null;
322 // Fake $wgRequest for some hooks inside EditPage
323 // @todo FIXME: This interface SUCKS
324 $oldRequest = $wgRequest;
325 $wgRequest = $req;
326
327 $status = $ep->internalAttemptSave( $result, $user->isAllowed( 'bot' ) && $params['bot'] );
328 $wgRequest = $oldRequest;
329 global $wgMaxArticleSize;
330
331 switch( $status->value ) {
332 case EditPage::AS_HOOK_ERROR:
333 case EditPage::AS_HOOK_ERROR_EXPECTED:
334 $this->dieUsageMsg( 'hookaborted' );
335
336 case EditPage::AS_PARSE_ERROR:
337 $this->dieUsage( $status->getMessage(), 'parseerror' );
338
339 case EditPage::AS_IMAGE_REDIRECT_ANON:
340 $this->dieUsageMsg( 'noimageredirect-anon' );
341
342 case EditPage::AS_IMAGE_REDIRECT_LOGGED:
343 $this->dieUsageMsg( 'noimageredirect-logged' );
344
345 case EditPage::AS_SPAM_ERROR:
346 $this->dieUsageMsg( array( 'spamdetected', $result['spam'] ) );
347
348 case EditPage::AS_BLOCKED_PAGE_FOR_USER:
349 $this->dieUsageMsg( 'blockedtext' );
350
351 case EditPage::AS_MAX_ARTICLE_SIZE_EXCEEDED:
352 case EditPage::AS_CONTENT_TOO_BIG:
353 $this->dieUsageMsg( array( 'contenttoobig', $wgMaxArticleSize ) );
354
355 case EditPage::AS_READ_ONLY_PAGE_ANON:
356 $this->dieUsageMsg( 'noedit-anon' );
357
358 case EditPage::AS_READ_ONLY_PAGE_LOGGED:
359 $this->dieUsageMsg( 'noedit' );
360
361 case EditPage::AS_READ_ONLY_PAGE:
362 $this->dieReadOnly();
363
364 case EditPage::AS_RATE_LIMITED:
365 $this->dieUsageMsg( 'actionthrottledtext' );
366
367 case EditPage::AS_ARTICLE_WAS_DELETED:
368 $this->dieUsageMsg( 'wasdeleted' );
369
370 case EditPage::AS_NO_CREATE_PERMISSION:
371 $this->dieUsageMsg( 'nocreate-loggedin' );
372
373 case EditPage::AS_BLANK_ARTICLE:
374 $this->dieUsageMsg( 'blankpage' );
375
376 case EditPage::AS_CONFLICT_DETECTED:
377 $this->dieUsageMsg( 'editconflict' );
378
379 // case EditPage::AS_SUMMARY_NEEDED: Can't happen since we set wpIgnoreBlankSummary
380 case EditPage::AS_TEXTBOX_EMPTY:
381 $this->dieUsageMsg( 'emptynewsection' );
382
383 case EditPage::AS_SUCCESS_NEW_ARTICLE:
384 $r['new'] = '';
385
386 case EditPage::AS_SUCCESS_UPDATE:
387 $r['result'] = 'Success';
388 $r['pageid'] = intval( $titleObj->getArticleID() );
389 $r['title'] = $titleObj->getPrefixedText();
390 $r['contentmodel'] = $titleObj->getContentModel();
391 $newRevId = $articleObject->getLatest();
392 if ( $newRevId == $oldRevId ) {
393 $r['nochange'] = '';
394 } else {
395 $r['oldrevid'] = intval( $oldRevId );
396 $r['newrevid'] = intval( $newRevId );
397 $r['newtimestamp'] = wfTimestamp( TS_ISO_8601,
398 $pageObj->getTimestamp() );
399 }
400 break;
401
402 case EditPage::AS_SUMMARY_NEEDED:
403 $this->dieUsageMsg( 'summaryrequired' );
404
405 case EditPage::AS_END:
406 default:
407 // $status came from WikiPage::doEdit()
408 $errors = $status->getErrorsArray();
409 $this->dieUsageMsg( $errors[0] ); // TODO: Add new errors to message map
410 break;
411 }
412 $apiResult->addValue( null, $this->getModuleName(), $r );
413 }
414
415 public function mustBePosted() {
416 return true;
417 }
418
419 public function isWriteMode() {
420 return true;
421 }
422
423 public function getDescription() {
424 return 'Create and edit pages.';
425 }
426
427 public function getPossibleErrors() {
428 global $wgMaxArticleSize;
429
430 return array_merge( parent::getPossibleErrors(),
431 $this->getTitleOrPageIdErrorMessage(),
432 array(
433 array( 'missingtext' ),
434 array( 'createonly-exists' ),
435 array( 'nocreate-missing' ),
436 array( 'nosuchrevid', 'undo' ),
437 array( 'nosuchrevid', 'undoafter' ),
438 array( 'revwrongpage', 'id', 'text' ),
439 array( 'undo-failure' ),
440 array( 'hashcheckfailed' ),
441 array( 'hookaborted' ),
442 array( 'code' => 'parseerror', 'info' => 'Failed to parse the given text.' ),
443 array( 'noimageredirect-anon' ),
444 array( 'noimageredirect-logged' ),
445 array( 'spamdetected', 'spam' ),
446 array( 'summaryrequired' ),
447 array( 'blockedtext' ),
448 array( 'contenttoobig', $wgMaxArticleSize ),
449 array( 'noedit-anon' ),
450 array( 'noedit' ),
451 array( 'actionthrottledtext' ),
452 array( 'wasdeleted' ),
453 array( 'nocreate-loggedin' ),
454 array( 'blankpage' ),
455 array( 'editconflict' ),
456 array( 'emptynewsection' ),
457 array( 'unknownerror', 'retval' ),
458 array( 'code' => 'nosuchsection', 'info' => 'There is no section section.' ),
459 array( 'code' => 'invalidsection', 'info' => 'The section parameter must be set to an integer or \'new\'' ),
460 array( 'code' => 'sectionsnotsupported', 'info' => 'Sections are not supported for this type of page.' ),
461 array( 'code' => 'editnotsupported', 'info' => 'Editing of this type of page is not supported using '
462 . 'the text based edit API.' ),
463 array( 'code' => 'appendnotsupported', 'info' => 'This type of page can not be edited by appending '
464 . 'or prepending text.' ),
465 array( 'code' => 'badformat', 'info' => 'The requested serialization format can not be applied to '
466 . 'the page\'s content model' ),
467 array( 'customcssprotected' ),
468 array( 'customjsprotected' ),
469 )
470 );
471 }
472
473 public function getAllowedParams() {
474 return array(
475 'title' => array(
476 ApiBase::PARAM_TYPE => 'string',
477 ),
478 'pageid' => array(
479 ApiBase::PARAM_TYPE => 'integer',
480 ),
481 'section' => null,
482 'sectiontitle' => array(
483 ApiBase::PARAM_TYPE => 'string',
484 ApiBase::PARAM_REQUIRED => false,
485 ),
486 'text' => null,
487 'token' => array(
488 ApiBase::PARAM_TYPE => 'string',
489 ApiBase::PARAM_REQUIRED => true
490 ),
491 'summary' => null,
492 'minor' => false,
493 'notminor' => false,
494 'bot' => false,
495 'basetimestamp' => null,
496 'starttimestamp' => null,
497 'recreate' => false,
498 'createonly' => false,
499 'nocreate' => false,
500 'watch' => array(
501 ApiBase::PARAM_DFLT => false,
502 ApiBase::PARAM_DEPRECATED => true,
503 ),
504 'unwatch' => array(
505 ApiBase::PARAM_DFLT => false,
506 ApiBase::PARAM_DEPRECATED => true,
507 ),
508 'watchlist' => array(
509 ApiBase::PARAM_DFLT => 'preferences',
510 ApiBase::PARAM_TYPE => array(
511 'watch',
512 'unwatch',
513 'preferences',
514 'nochange'
515 ),
516 ),
517 'md5' => null,
518 'prependtext' => null,
519 'appendtext' => null,
520 'undo' => array(
521 ApiBase::PARAM_TYPE => 'integer'
522 ),
523 'undoafter' => array(
524 ApiBase::PARAM_TYPE => 'integer'
525 ),
526 'redirect' => array(
527 ApiBase::PARAM_TYPE => 'boolean',
528 ApiBase::PARAM_DFLT => false,
529 ),
530 'contentformat' => array(
531 ApiBase::PARAM_TYPE => ContentHandler::getAllContentFormats(),
532 ),
533 'contentmodel' => array(
534 ApiBase::PARAM_TYPE => ContentHandler::getContentModels(),
535 )
536 );
537 }
538
539 public function getParamDescription() {
540 $p = $this->getModulePrefix();
541 return array(
542 'title' => "Title of the page you want to edit. Cannot be used together with {$p}pageid",
543 'pageid' => "Page ID of the page you want to edit. Cannot be used together with {$p}title",
544 'section' => 'Section number. 0 for the top section, \'new\' for a new section',
545 'sectiontitle' => 'The title for a new section',
546 'text' => 'Page content',
547 'token' => array( 'Edit token. You can get one of these through prop=info.',
548 "The token should always be sent as the last parameter, or at least, after the {$p}text parameter"
549 ),
550 'summary' => "Edit summary. Also section title when {$p}section=new and {$p}sectiontitle is not set",
551 'minor' => 'Minor edit',
552 'notminor' => 'Non-minor edit',
553 'bot' => 'Mark this edit as bot',
554 'basetimestamp' => array( 'Timestamp of the base revision (obtained through prop=revisions&rvprop=timestamp).',
555 'Used to detect edit conflicts; leave unset to ignore conflicts'
556 ),
557 'starttimestamp' => array( 'Timestamp when you obtained the edit token.',
558 'Used to detect edit conflicts; leave unset to ignore conflicts'
559 ),
560 'recreate' => 'Override any errors about the article having been deleted in the meantime',
561 'createonly' => 'Don\'t edit the page if it exists already',
562 'nocreate' => 'Throw an error if the page doesn\'t exist',
563 'watch' => 'Add the page to your watchlist',
564 'unwatch' => 'Remove the page from your watchlist',
565 'watchlist' => 'Unconditionally add or remove the page from your watchlist, use preferences or do not change watch',
566 'md5' => array( "The MD5 hash of the {$p}text parameter, or the {$p}prependtext and {$p}appendtext parameters concatenated.",
567 'If set, the edit won\'t be done unless the hash is correct' ),
568 'prependtext' => "Add this text to the beginning of the page. Overrides {$p}text",
569 'appendtext' => array( "Add this text to the end of the page. Overrides {$p}text.",
570 "Use {$p}section=new to append a new section" ),
571 'undo' => "Undo this revision. Overrides {$p}text, {$p}prependtext and {$p}appendtext",
572 'undoafter' => 'Undo all revisions from undo to this one. If not set, just undo one revision',
573 'redirect' => 'Automatically resolve redirects',
574 'contentformat' => 'Content serialization format used for the input text',
575 'contentmodel' => 'Content model of the new content',
576 );
577 }
578
579 public function getResultProperties() {
580 return array(
581 '' => array(
582 'new' => 'boolean',
583 'result' => array(
584 ApiBase::PROP_TYPE => array(
585 'Success',
586 'Failure'
587 ),
588 ),
589 'pageid' => array(
590 ApiBase::PROP_TYPE => 'integer',
591 ApiBase::PROP_NULLABLE => true
592 ),
593 'title' => array(
594 ApiBase::PROP_TYPE => 'string',
595 ApiBase::PROP_NULLABLE => true
596 ),
597 'nochange' => 'boolean',
598 'oldrevid' => array(
599 ApiBase::PROP_TYPE => 'integer',
600 ApiBase::PROP_NULLABLE => true
601 ),
602 'newrevid' => array(
603 ApiBase::PROP_TYPE => 'integer',
604 ApiBase::PROP_NULLABLE => true
605 ),
606 'newtimestamp' => array(
607 ApiBase::PROP_TYPE => 'string',
608 ApiBase::PROP_NULLABLE => true
609 )
610 )
611 );
612 }
613
614 public function needsToken() {
615 return true;
616 }
617
618 public function getTokenSalt() {
619 return '';
620 }
621
622 public function getExamples() {
623 return array(
624
625 'api.php?action=edit&title=Test&summary=test%20summary&text=article%20content&basetimestamp=20070824123454&token=%2B\\'
626 => 'Edit a page (anonymous user)',
627
628 'api.php?action=edit&title=Test&summary=NOTOC&minor=&prependtext=__NOTOC__%0A&basetimestamp=20070824123454&token=%2B\\'
629 => 'Prepend __NOTOC__ to a page (anonymous user)',
630 'api.php?action=edit&title=Test&undo=13585&undoafter=13579&basetimestamp=20070824123454&token=%2B\\'
631 => 'Undo r13579 through r13585 with autosummary (anonymous user)',
632 );
633 }
634
635 public function getHelpUrls() {
636 return 'https://www.mediawiki.org/wiki/API:Edit';
637 }
638
639 public function getVersion() {
640 return __CLASS__ . ': $Id$';
641 }
642 }