// Deprecated parameters
if ( $params['watch'] ) {
+ $this->logFeatureUsage( 'action=edit&watch' );
$watch = true;
} elseif ( $params['unwatch'] ) {
+ $this->logFeatureUsage( 'action=edit&unwatch' );
$watch = false;
}
return 'Create and edit pages.';
}
- public function getPossibleErrors() {
- return array_merge( parent::getPossibleErrors(),
- $this->getTitleOrPageIdErrorMessage(),
- array(
- array( 'missingtext' ),
- array( 'createonly-exists' ),
- array( 'nocreate-missing' ),
- array( 'nosuchrevid', 'undo' ),
- array( 'nosuchrevid', 'undoafter' ),
- array( 'revwrongpage', 'id', 'text' ),
- array( 'undo-failure' ),
- array( 'hashcheckfailed' ),
- array( 'hookaborted' ),
- array( 'code' => 'parseerror', 'info' => 'Failed to parse the given text.' ),
- array( 'noimageredirect-anon' ),
- array( 'noimageredirect-logged' ),
- array( 'spamdetected', 'spam' ),
- array( 'summaryrequired' ),
- array( 'blockedtext' ),
- array( 'contenttoobig', $this->getConfig()->get( 'MaxArticleSize' ) ),
- array( 'noedit-anon' ),
- array( 'noedit' ),
- array( 'actionthrottledtext' ),
- array( 'wasdeleted' ),
- array( 'nocreate-loggedin' ),
- array( 'blankpage' ),
- array( 'editconflict' ),
- array( 'emptynewsection' ),
- array( 'unknownerror', 'retval' ),
- array( 'code' => 'nosuchsection', 'info' => 'There is no such section.' ),
- array(
- 'code' => 'invalidsection',
- 'info' => 'The section parameter must be a valid section id or \'new\''
- ),
- array(
- 'code' => 'sectionsnotsupported',
- 'info' => 'Sections are not supported for this type of page.'
- ),
- array(
- 'code' => 'editnotsupported',
- 'info' => 'Editing of this type of page is not supported using the text based edit API.'
- ),
- array(
- 'code' => 'appendnotsupported',
- 'info' => 'This type of page can not be edited by appending or prepending text.' ),
- array(
- 'code' => 'redirect-appendonly',
- 'info' => 'You have attempted to edit using the "redirect"-following mode, which must be used in conjuction with section=new, prependtext, or appendtext.',
- ),
- array(
- 'code' => 'badformat',
- 'info' => 'The requested serialization format can not be applied to the page\'s content model'
- ),
- array( 'customcssprotected' ),
- array( 'customjsprotected' ),
- )
- );
- }
-
public function getAllowedParams() {
return array(
'title' => array(
ApiBase::PARAM_TYPE => 'string',
),
'text' => null,
- 'token' => array(
- ApiBase::PARAM_TYPE => 'string',
- ApiBase::PARAM_REQUIRED => true
- ),
'summary' => null,
'minor' => false,
'notminor' => false,
'sectiontitle' => 'The title for a new section',
'text' => 'Page content',
'token' => array(
- 'Edit token. You can get one of these through prop=info.',
- "The token should always be sent as the last parameter, or at " .
+ /* Standard description is automatically prepended */
+ 'The token should always be sent as the last parameter, or at ' .
"least, after the {$p}text parameter"
),
'summary'
'Used to detect edit conflicts; leave unset to ignore conflicts'
),
'starttimestamp' => array(
- 'Timestamp when you obtained the edit token.',
+ 'Timestamp when you began the editing process, e.g. when the current page content ' .
+ 'was loaded for editing.',
'Used to detect edit conflicts; leave unset to ignore conflicts'
),
'recreate' => 'Override any errors about the article having been deleted in the meantime',
);
}
- public function getResultProperties() {
- return array(
- '' => array(
- 'new' => 'boolean',
- 'result' => array(
- ApiBase::PROP_TYPE => array(
- 'Success',
- 'Failure'
- ),
- ),
- 'pageid' => array(
- ApiBase::PROP_TYPE => 'integer',
- ApiBase::PROP_NULLABLE => true
- ),
- 'title' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- ),
- 'nochange' => 'boolean',
- 'oldrevid' => array(
- ApiBase::PROP_TYPE => 'integer',
- ApiBase::PROP_NULLABLE => true
- ),
- 'newrevid' => array(
- ApiBase::PROP_TYPE => 'integer',
- ApiBase::PROP_NULLABLE => true
- ),
- 'newtimestamp' => array(
- ApiBase::PROP_TYPE => 'string',
- ApiBase::PROP_NULLABLE => true
- )
- )
- );
- }
-
public function needsToken() {
- return true;
- }
-
- public function getTokenSalt() {
- return '';
+ return 'csrf';
}
public function getExamples() {