ApiVisualEditor: avoid some unset variable notices

Bug: T176440
Change-Id: I571fbea79bd7f656cd367a5d8a773408fd80c7cf
This commit is contained in:
David Lynch 2017-10-04 09:44:58 -05:00
parent d0193b3eda
commit c89a2a9e76

View file

@ -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;
}