mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-23 22:13:34 +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 'parsefragment':
|
||||
$wikitext = $params['wikitext'];
|
||||
if ( $wikitext === null ) {
|
||||
$this->dieWithError( [ 'apierror-missingparam', 'wikitext' ] );
|
||||
}
|
||||
$bodyOnly = ( $params['paction'] === 'parsefragment' );
|
||||
if ( $params['pst'] ) {
|
||||
$wikitext = $this->pstWikitext( $title, $wikitext );
|
||||
|
|
Loading…
Reference in a new issue