mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
ApiVisualEditor: avoid some unset variable notices
Bug: T176440 Change-Id: I571fbea79bd7f656cd367a5d8a773408fd80c7cf
This commit is contained in:
parent
d0193b3eda
commit
c89a2a9e76
|
@ -282,7 +282,7 @@ class ApiVisualEditor extends ApiBase {
|
|||
|
||||
if ( $section === 'new' ) {
|
||||
$content = '';
|
||||
if ( $params['preload'] ) {
|
||||
if ( !empty( $params['preload'] ) ) {
|
||||
$content = $this->getPreloadContent(
|
||||
$params['preload'], $params['preloadparams'], $title,
|
||||
$params['paction'] !== 'wikitext'
|
||||
|
@ -322,7 +322,7 @@ class ApiVisualEditor extends ApiBase {
|
|||
if ( $content !== '' ) {
|
||||
$content = $this->parseWikitextFragment( $title, $content );
|
||||
}
|
||||
if ( $content === '' && $params['preload'] ) {
|
||||
if ( $content === '' && !empty( $params['preload'] ) ) {
|
||||
$content = $this->getPreloadContent(
|
||||
$params['preload'], $params['preloadparams'], $title,
|
||||
$params['paction'] !== 'wikitext'
|
||||
|
@ -581,7 +581,7 @@ class ApiVisualEditor extends ApiBase {
|
|||
];
|
||||
if ( $params['paction'] === 'parse' ||
|
||||
$params['paction'] === 'wikitext' ||
|
||||
( $params['preload'] && $content )
|
||||
( !empty( $params['preload'] ) && $content )
|
||||
) {
|
||||
$result['content'] = $content;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue