Merge "Allow ORMTable to access a foreign wiki."
[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, $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 // @todo: Add support for appending/prepending to the Content interface
132
133 if ( !( $content instanceof TextContent ) ) {
134 $mode = $contentHandler->getModelID();
135 $this->dieUsage( "Can't append to pages using content model $mode", 'appendnotsupported' );
136 }
137
138 if ( !$content ) {
139 # If this is a MediaWiki:x message, then load the messages
140 # and return the message value for x.
141 if ( $titleObj->getNamespace() == NS_MEDIAWIKI ) {
142 $text = $titleObj->getDefaultMessageText();
143 if ( $text === false ) {
144 $text = '';
145 }
146
147 try {
148 $content = ContentHandler::makeContent( $text, $this->getTitle() );
149 } catch ( MWContentSerializationException $ex ) {
150 $this->dieUsage( $ex->getMessage(), 'parseerror' );
151 return;
152 }
153 }
154 }
155
156 if ( !is_null( $params['section'] ) ) {
157 if ( !$contentHandler->supportsSections() ) {
158 $modelName = $contentHandler->getModelID();
159 $this->dieUsage( "Sections are not supported for this content model: $modelName.", 'sectionsnotsupported' );
160 }
161
162 // Process the content for section edits
163 $section = intval( $params['section'] );
164 $content = $content->getSection( $section );
165
166 if ( !$content ) {
167 $this->dieUsage( "There is no section {$section}.", 'nosuchsection' );
168 }
169 }
170
171 if ( !$content ) {
172 $text = '';
173 } else {
174 $text = $content->serialize( $contentFormat );
175 }
176
177 $params['text'] = $params['prependtext'] . $text . $params['appendtext'];
178 $toMD5 = $params['prependtext'] . $params['appendtext'];
179 }
180
181 if ( $params['undo'] > 0 ) {
182 if ( $params['undoafter'] > 0 ) {
183 if ( $params['undo'] < $params['undoafter'] ) {
184 list( $params['undo'], $params['undoafter'] ) =
185 array( $params['undoafter'], $params['undo'] );
186 }
187 $undoafterRev = Revision::newFromID( $params['undoafter'] );
188 }
189 $undoRev = Revision::newFromID( $params['undo'] );
190 if ( is_null( $undoRev ) || $undoRev->isDeleted( Revision::DELETED_TEXT ) ) {
191 $this->dieUsageMsg( array( 'nosuchrevid', $params['undo'] ) );
192 }
193
194 if ( $params['undoafter'] == 0 ) {
195 $undoafterRev = $undoRev->getPrevious();
196 }
197 if ( is_null( $undoafterRev ) || $undoafterRev->isDeleted( Revision::DELETED_TEXT ) ) {
198 $this->dieUsageMsg( array( 'nosuchrevid', $params['undoafter'] ) );
199 }
200
201 if ( $undoRev->getPage() != $pageObj->getID() ) {
202 $this->dieUsageMsg( array( 'revwrongpage', $undoRev->getID(), $titleObj->getPrefixedText() ) );
203 }
204 if ( $undoafterRev->getPage() != $pageObj->getID() ) {
205 $this->dieUsageMsg( array( 'revwrongpage', $undoafterRev->getID(), $titleObj->getPrefixedText() ) );
206 }
207
208 $newContent = $contentHandler->getUndoContent( $pageObj->getRevision(), $undoRev, $undoafterRev );
209
210 if ( !$newContent ) {
211 $this->dieUsageMsg( 'undo-failure' );
212 }
213
214 $params['text'] = $newContent->serialize( $params['contentformat'] );
215
216 // If no summary was given and we only undid one rev,
217 // use an autosummary
218 if ( is_null( $params['summary'] ) && $titleObj->getNextRevisionID( $undoafterRev->getID() ) == $params['undo'] ) {
219 $params['summary'] = wfMessage( 'undo-summary', $params['undo'], $undoRev->getUserText() )->inContentLanguage()->text();
220 }
221 }
222
223 // See if the MD5 hash checks out
224 if ( !is_null( $params['md5'] ) && md5( $toMD5 ) !== $params['md5'] ) {
225 $this->dieUsageMsg( 'hashcheckfailed' );
226 }
227
228 // EditPage wants to parse its stuff from a WebRequest
229 // That interface kind of sucks, but it's workable
230 $requestArray = array(
231 'wpTextbox1' => $params['text'],
232 'format' => $contentFormat,
233 'model' => $contentHandler->getModelID(),
234 'wpEditToken' => $params['token'],
235 'wpIgnoreBlankSummary' => ''
236 );
237
238 if ( !is_null( $params['summary'] ) ) {
239 $requestArray['wpSummary'] = $params['summary'];
240 }
241
242 if ( !is_null( $params['sectiontitle'] ) ) {
243 $requestArray['wpSectionTitle'] = $params['sectiontitle'];
244 }
245
246 // Watch out for basetimestamp == ''
247 // wfTimestamp() treats it as NOW, almost certainly causing an edit conflict
248 if ( !is_null( $params['basetimestamp'] ) && $params['basetimestamp'] != '' ) {
249 $requestArray['wpEdittime'] = wfTimestamp( TS_MW, $params['basetimestamp'] );
250 } else {
251 $requestArray['wpEdittime'] = $pageObj->getTimestamp();
252 }
253
254 if ( !is_null( $params['starttimestamp'] ) && $params['starttimestamp'] != '' ) {
255 $requestArray['wpStarttime'] = wfTimestamp( TS_MW, $params['starttimestamp'] );
256 } else {
257 $requestArray['wpStarttime'] = wfTimestampNow(); // Fake wpStartime
258 }
259
260 if ( $params['minor'] || ( !$params['notminor'] && $user->getOption( 'minordefault' ) ) ) {
261 $requestArray['wpMinoredit'] = '';
262 }
263
264 if ( $params['recreate'] ) {
265 $requestArray['wpRecreate'] = '';
266 }
267
268 if ( !is_null( $params['section'] ) ) {
269 $section = intval( $params['section'] );
270 if ( $section == 0 && $params['section'] != '0' && $params['section'] != 'new' ) {
271 $this->dieUsage( "The section parameter must be set to an integer or 'new'", "invalidsection" );
272 }
273 $requestArray['wpSection'] = $params['section'];
274 } else {
275 $requestArray['wpSection'] = '';
276 }
277
278 $watch = $this->getWatchlistValue( $params['watchlist'], $titleObj );
279
280 // Deprecated parameters
281 if ( $params['watch'] ) {
282 $watch = true;
283 } elseif ( $params['unwatch'] ) {
284 $watch = false;
285 }
286
287 if ( $watch ) {
288 $requestArray['wpWatchthis'] = '';
289 }
290
291 global $wgTitle, $wgRequest;
292
293 $req = new DerivativeRequest( $this->getRequest(), $requestArray, true );
294
295 // Some functions depend on $wgTitle == $ep->mTitle
296 // TODO: Make them not or check if they still do
297 $wgTitle = $titleObj;
298
299 $articleObject = new Article( $titleObj );
300 $ep = new EditPage( $articleObject );
301
302 // allow editing of non-textual content.
303 $ep->allowNonTextContent = true;
304
305 $ep->setContextTitle( $titleObj );
306 $ep->importFormData( $req );
307
308 // Run hooks
309 // Handle APIEditBeforeSave parameters
310 $r = array();
311 if ( !wfRunHooks( 'APIEditBeforeSave', array( $ep, $ep->textbox1, &$r ) ) ) {
312 if ( count( $r ) ) {
313 $r['result'] = 'Failure';
314 $apiResult->addValue( null, $this->getModuleName(), $r );
315 return;
316 } else {
317 $this->dieUsageMsg( 'hookaborted' );
318 }
319 }
320
321 // Do the actual save
322 $oldRevId = $articleObject->getRevIdFetched();
323 $result = null;
324 // Fake $wgRequest for some hooks inside EditPage
325 // @todo FIXME: This interface SUCKS
326 $oldRequest = $wgRequest;
327 $wgRequest = $req;
328
329 $status = $ep->internalAttemptSave( $result, $user->isAllowed( 'bot' ) && $params['bot'] );
330 $wgRequest = $oldRequest;
331 global $wgMaxArticleSize;
332
333 switch( $status->value ) {
334 case EditPage::AS_HOOK_ERROR:
335 case EditPage::AS_HOOK_ERROR_EXPECTED:
336 $this->dieUsageMsg( 'hookaborted' );
337
338 case EditPage::AS_PARSE_ERROR:
339 $this->dieUsage( $status->getMessage(), 'parseerror' );
340
341 case EditPage::AS_IMAGE_REDIRECT_ANON:
342 $this->dieUsageMsg( 'noimageredirect-anon' );
343
344 case EditPage::AS_IMAGE_REDIRECT_LOGGED:
345 $this->dieUsageMsg( 'noimageredirect-logged' );
346
347 case EditPage::AS_SPAM_ERROR:
348 $this->dieUsageMsg( array( 'spamdetected', $result['spam'] ) );
349
350 case EditPage::AS_BLOCKED_PAGE_FOR_USER:
351 $this->dieUsageMsg( 'blockedtext' );
352
353 case EditPage::AS_MAX_ARTICLE_SIZE_EXCEEDED:
354 case EditPage::AS_CONTENT_TOO_BIG:
355 $this->dieUsageMsg( array( 'contenttoobig', $wgMaxArticleSize ) );
356
357 case EditPage::AS_READ_ONLY_PAGE_ANON:
358 $this->dieUsageMsg( 'noedit-anon' );
359
360 case EditPage::AS_READ_ONLY_PAGE_LOGGED:
361 $this->dieUsageMsg( 'noedit' );
362
363 case EditPage::AS_READ_ONLY_PAGE:
364 $this->dieReadOnly();
365
366 case EditPage::AS_RATE_LIMITED:
367 $this->dieUsageMsg( 'actionthrottledtext' );
368
369 case EditPage::AS_ARTICLE_WAS_DELETED:
370 $this->dieUsageMsg( 'wasdeleted' );
371
372 case EditPage::AS_NO_CREATE_PERMISSION:
373 $this->dieUsageMsg( 'nocreate-loggedin' );
374
375 case EditPage::AS_BLANK_ARTICLE:
376 $this->dieUsageMsg( 'blankpage' );
377
378 case EditPage::AS_CONFLICT_DETECTED:
379 $this->dieUsageMsg( 'editconflict' );
380
381 // case EditPage::AS_SUMMARY_NEEDED: Can't happen since we set wpIgnoreBlankSummary
382 case EditPage::AS_TEXTBOX_EMPTY:
383 $this->dieUsageMsg( 'emptynewsection' );
384
385 case EditPage::AS_SUCCESS_NEW_ARTICLE:
386 $r['new'] = '';
387
388 case EditPage::AS_SUCCESS_UPDATE:
389 $r['result'] = 'Success';
390 $r['pageid'] = intval( $titleObj->getArticleID() );
391 $r['title'] = $titleObj->getPrefixedText();
392 $r['contentmodel'] = $titleObj->getContentModel();
393 $newRevId = $articleObject->getLatest();
394 if ( $newRevId == $oldRevId ) {
395 $r['nochange'] = '';
396 } else {
397 $r['oldrevid'] = intval( $oldRevId );
398 $r['newrevid'] = intval( $newRevId );
399 $r['newtimestamp'] = wfTimestamp( TS_ISO_8601,
400 $pageObj->getTimestamp() );
401 }
402 break;
403
404 case EditPage::AS_SUMMARY_NEEDED:
405 $this->dieUsageMsg( 'summaryrequired' );
406
407 case EditPage::AS_END:
408 default:
409 // $status came from WikiPage::doEdit()
410 $errors = $status->getErrorsArray();
411 $this->dieUsageMsg( $errors[0] ); // TODO: Add new errors to message map
412 break;
413 }
414 $apiResult->addValue( null, $this->getModuleName(), $r );
415 }
416
417 public function mustBePosted() {
418 return true;
419 }
420
421 public function isWriteMode() {
422 return true;
423 }
424
425 public function getDescription() {
426 return 'Create and edit pages.';
427 }
428
429 public function getPossibleErrors() {
430 global $wgMaxArticleSize;
431
432 return array_merge( parent::getPossibleErrors(),
433 $this->getTitleOrPageIdErrorMessage(),
434 array(
435 array( 'missingtext' ),
436 array( 'createonly-exists' ),
437 array( 'nocreate-missing' ),
438 array( 'nosuchrevid', 'undo' ),
439 array( 'nosuchrevid', 'undoafter' ),
440 array( 'revwrongpage', 'id', 'text' ),
441 array( 'undo-failure' ),
442 array( 'hashcheckfailed' ),
443 array( 'hookaborted' ),
444 array( 'code' => 'parseerror', 'info' => 'Failed to parse the given text.' ),
445 array( 'noimageredirect-anon' ),
446 array( 'noimageredirect-logged' ),
447 array( 'spamdetected', 'spam' ),
448 array( 'summaryrequired' ),
449 array( 'blockedtext' ),
450 array( 'contenttoobig', $wgMaxArticleSize ),
451 array( 'noedit-anon' ),
452 array( 'noedit' ),
453 array( 'actionthrottledtext' ),
454 array( 'wasdeleted' ),
455 array( 'nocreate-loggedin' ),
456 array( 'blankpage' ),
457 array( 'editconflict' ),
458 array( 'emptynewsection' ),
459 array( 'unknownerror', 'retval' ),
460 array( 'code' => 'nosuchsection', 'info' => 'There is no section section.' ),
461 array( 'code' => 'invalidsection', 'info' => 'The section parameter must be set to an integer or \'new\'' ),
462 array( 'code' => 'sectionsnotsupported', 'info' => 'Sections are not supported for this type of page.' ),
463 array( 'code' => 'editnotsupported', 'info' => 'Editing of this type of page is not supported using '
464 . 'the text based edit API.' ),
465 array( 'code' => 'appendnotsupported', 'info' => 'This type of page can not be edited by appending '
466 . 'or prepending text.' ),
467 array( 'code' => 'badformat', 'info' => 'The requested serialization format can not be applied to '
468 . 'the page\'s content model' ),
469 array( 'customcssprotected' ),
470 array( 'customjsprotected' ),
471 )
472 );
473 }
474
475 public function getAllowedParams() {
476 return array(
477 'title' => array(
478 ApiBase::PARAM_TYPE => 'string',
479 ),
480 'pageid' => array(
481 ApiBase::PARAM_TYPE => 'integer',
482 ),
483 'section' => null,
484 'sectiontitle' => array(
485 ApiBase::PARAM_TYPE => 'string',
486 ApiBase::PARAM_REQUIRED => false,
487 ),
488 'text' => null,
489 'token' => array(
490 ApiBase::PARAM_TYPE => 'string',
491 ApiBase::PARAM_REQUIRED => true
492 ),
493 'summary' => null,
494 'minor' => false,
495 'notminor' => false,
496 'bot' => false,
497 'basetimestamp' => null,
498 'starttimestamp' => null,
499 'recreate' => false,
500 'createonly' => false,
501 'nocreate' => false,
502 'watch' => array(
503 ApiBase::PARAM_DFLT => false,
504 ApiBase::PARAM_DEPRECATED => true,
505 ),
506 'unwatch' => array(
507 ApiBase::PARAM_DFLT => false,
508 ApiBase::PARAM_DEPRECATED => true,
509 ),
510 'watchlist' => array(
511 ApiBase::PARAM_DFLT => 'preferences',
512 ApiBase::PARAM_TYPE => array(
513 'watch',
514 'unwatch',
515 'preferences',
516 'nochange'
517 ),
518 ),
519 'md5' => null,
520 'prependtext' => null,
521 'appendtext' => null,
522 'undo' => array(
523 ApiBase::PARAM_TYPE => 'integer'
524 ),
525 'undoafter' => array(
526 ApiBase::PARAM_TYPE => 'integer'
527 ),
528 'redirect' => array(
529 ApiBase::PARAM_TYPE => 'boolean',
530 ApiBase::PARAM_DFLT => false,
531 ),
532 'contentformat' => array(
533 ApiBase::PARAM_TYPE => ContentHandler::getAllContentFormats(),
534 ),
535 'contentmodel' => array(
536 ApiBase::PARAM_TYPE => ContentHandler::getContentModels(),
537 )
538 );
539 }
540
541 public function getParamDescription() {
542 $p = $this->getModulePrefix();
543 return array(
544 'title' => "Title of the page you want to edit. Cannot be used together with {$p}pageid",
545 'pageid' => "Page ID of the page you want to edit. Cannot be used together with {$p}title",
546 'section' => 'Section number. 0 for the top section, \'new\' for a new section',
547 'sectiontitle' => 'The title for a new section',
548 'text' => 'Page content',
549 'token' => array( 'Edit token. You can get one of these through prop=info.',
550 "The token should always be sent as the last parameter, or at least, after the {$p}text parameter"
551 ),
552 'summary' => "Edit summary. Also section title when {$p}section=new and {$p}sectiontitle is not set",
553 'minor' => 'Minor edit',
554 'notminor' => 'Non-minor edit',
555 'bot' => 'Mark this edit as bot',
556 'basetimestamp' => array( 'Timestamp of the base revision (obtained through prop=revisions&rvprop=timestamp).',
557 'Used to detect edit conflicts; leave unset to ignore conflicts'
558 ),
559 'starttimestamp' => array( 'Timestamp when you obtained the edit token.',
560 'Used to detect edit conflicts; leave unset to ignore conflicts'
561 ),
562 'recreate' => 'Override any errors about the article having been deleted in the meantime',
563 'createonly' => 'Don\'t edit the page if it exists already',
564 'nocreate' => 'Throw an error if the page doesn\'t exist',
565 'watch' => 'Add the page to your watchlist',
566 'unwatch' => 'Remove the page from your watchlist',
567 'watchlist' => 'Unconditionally add or remove the page from your watchlist, use preferences or do not change watch',
568 'md5' => array( "The MD5 hash of the {$p}text parameter, or the {$p}prependtext and {$p}appendtext parameters concatenated.",
569 'If set, the edit won\'t be done unless the hash is correct' ),
570 'prependtext' => "Add this text to the beginning of the page. Overrides {$p}text",
571 'appendtext' => array( "Add this text to the end of the page. Overrides {$p}text.",
572 "Use {$p}section=new to append a new section" ),
573 'undo' => "Undo this revision. Overrides {$p}text, {$p}prependtext and {$p}appendtext",
574 'undoafter' => 'Undo all revisions from undo to this one. If not set, just undo one revision',
575 'redirect' => 'Automatically resolve redirects',
576 'contentformat' => 'Content serialization format used for the input text',
577 'contentmodel' => 'Content model of the new content',
578 );
579 }
580
581 public function getResultProperties() {
582 return array(
583 '' => array(
584 'new' => 'boolean',
585 'result' => array(
586 ApiBase::PROP_TYPE => array(
587 'Success',
588 'Failure'
589 ),
590 ),
591 'pageid' => array(
592 ApiBase::PROP_TYPE => 'integer',
593 ApiBase::PROP_NULLABLE => true
594 ),
595 'title' => array(
596 ApiBase::PROP_TYPE => 'string',
597 ApiBase::PROP_NULLABLE => true
598 ),
599 'nochange' => 'boolean',
600 'oldrevid' => array(
601 ApiBase::PROP_TYPE => 'integer',
602 ApiBase::PROP_NULLABLE => true
603 ),
604 'newrevid' => array(
605 ApiBase::PROP_TYPE => 'integer',
606 ApiBase::PROP_NULLABLE => true
607 ),
608 'newtimestamp' => array(
609 ApiBase::PROP_TYPE => 'string',
610 ApiBase::PROP_NULLABLE => true
611 )
612 )
613 );
614 }
615
616 public function needsToken() {
617 return true;
618 }
619
620 public function getTokenSalt() {
621 return '';
622 }
623
624 public function getExamples() {
625 return array(
626
627 'api.php?action=edit&title=Test&summary=test%20summary&text=article%20content&basetimestamp=20070824123454&token=%2B\\'
628 => 'Edit a page (anonymous user)',
629
630 'api.php?action=edit&title=Test&summary=NOTOC&minor=&prependtext=__NOTOC__%0A&basetimestamp=20070824123454&token=%2B\\'
631 => 'Prepend __NOTOC__ to a page (anonymous user)',
632 'api.php?action=edit&title=Test&undo=13585&undoafter=13579&basetimestamp=20070824123454&token=%2B\\'
633 => 'Undo r13579 through r13585 with autosummary (anonymous user)',
634 );
635 }
636
637 public function getHelpUrls() {
638 return 'https://www.mediawiki.org/wiki/API:Edit';
639 }
640
641 public function getVersion() {
642 return __CLASS__ . ': $Id$';
643 }
644 }