mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 06:24:08 +00:00
api: Better error when 'wikitext' parameter is required
Bug: T280072 Change-Id: Ibd03aa2a527ac2d27ef7c3dbaf25df74a2a0fdc5
This commit is contained in:
parent
43c1ec5f42
commit
aec35a67d0
|
@ -542,6 +542,9 @@ class ApiVisualEditor extends ApiBase {
|
||||||
case 'parsedoc':
|
case 'parsedoc':
|
||||||
case 'parsefragment':
|
case 'parsefragment':
|
||||||
$wikitext = $params['wikitext'];
|
$wikitext = $params['wikitext'];
|
||||||
|
if ( $wikitext === null ) {
|
||||||
|
$this->dieWithError( [ 'apierror-missingparam', 'wikitext' ] );
|
||||||
|
}
|
||||||
$bodyOnly = ( $params['paction'] === 'parsefragment' );
|
$bodyOnly = ( $params['paction'] === 'parsefragment' );
|
||||||
if ( $params['pst'] ) {
|
if ( $params['pst'] ) {
|
||||||
$wikitext = $this->pstWikitext( $title, $wikitext );
|
$wikitext = $this->pstWikitext( $title, $wikitext );
|
||||||
|
|
Loading…
Reference in a new issue