}
}
+ // Use comment as initial page text by default
+ if (is_null($this->mParams['text']))
+ $this->mParams['text'] = $this->mParams['comment'];
+
// No errors, no warnings: do the upload
$status = $this->mUpload->performUpload( $this->mParams['comment'],
- $this->mParams['comment'], $this->mParams['watch'], $wgUser );
+ $this->mParams['text'], $this->mParams['watch'], $wgUser );
if( !$status->isGood() ) {
$error = $status->getErrorsArray();
'comment' => array(
ApiBase::PARAM_DFLT => ''
),
+ 'text' => null,
'token' => null,
'watch' => false,
'ignorewarnings' => false,
return array(
'filename' => 'Target filename',
'token' => 'Edit token. You can get one of these through prop=info',
- 'comment' => 'Upload comment. Also used as the initial page text for new files',
+ 'comment' => 'Upload comment. Also used as the initial page text for new files if "text" is not specified',
+ 'text' => 'Initial page text for new files',
'watch' => 'Watch the page',
'ignorewarnings' => 'Ignore any warnings',
'file' => 'File contents',