Merge "ApiVisualEditor: Fix 'false' used as content for non-existent system messages"

This commit is contained in:
jenkins-bot 2020-08-17 12:29:49 +00:00 committed by Gerrit Code Review
commit 7d366a3f6a

View file

@ -211,7 +211,10 @@ class ApiVisualEditor extends ApiBase {
$content = '';
if ( $title->getNamespace() == NS_MEDIAWIKI && $params['section'] !== 'new' ) {
// If this is a system message, get the default text.
$content = $title->getDefaultMessageText();
$msg = $title->getDefaultMessageText();
if ( $msg !== false ) {
$content = $title->getDefaultMessageText();
}
}
Hooks::run( 'EditFormPreloadText', [ &$content, &$title ] );
if ( $content === '' && !empty( $params['preload'] ) ) {