Index: trunk/phase3/includes/api/ApiUpload.php |
— | — | @@ -291,9 +291,13 @@ |
292 | 292 | } |
293 | 293 | } |
294 | 294 | |
| 295 | + // Use comment as initial page text by default |
| 296 | + if (is_null($this->mParams['text'])) |
| 297 | + $this->mParams['text'] = $this->mParams['comment']; |
| 298 | + |
295 | 299 | // No errors, no warnings: do the upload |
296 | 300 | $status = $this->mUpload->performUpload( $this->mParams['comment'], |
297 | | - $this->mParams['comment'], $this->mParams['watch'], $wgUser ); |
| 301 | + $this->mParams['text'], $this->mParams['watch'], $wgUser ); |
298 | 302 | |
299 | 303 | if( !$status->isGood() ) { |
300 | 304 | $error = $status->getErrorsArray(); |
— | — | @@ -329,6 +333,7 @@ |
330 | 334 | 'comment' => array( |
331 | 335 | ApiBase::PARAM_DFLT => '' |
332 | 336 | ), |
| 337 | + 'text' => null, |
333 | 338 | 'token' => null, |
334 | 339 | 'watch' => false, |
335 | 340 | 'ignorewarnings' => false, |
— | — | @@ -355,7 +360,8 @@ |
356 | 361 | return array( |
357 | 362 | 'filename' => 'Target filename', |
358 | 363 | 'token' => 'Edit token. You can get one of these through prop=info', |
359 | | - 'comment' => 'Upload comment. Also used as the initial page text for new files', |
| 364 | + 'comment' => 'Upload comment. Also used as the initial page text for new files if "text" is not specified', |
| 365 | + 'text' => 'Initial page text for new files', |
360 | 366 | 'watch' => 'Watch the page', |
361 | 367 | 'ignorewarnings' => 'Ignore any warnings', |
362 | 368 | 'file' => 'File contents', |