From e061cd5c3a5b9876a693294069a2bf22dcf8a21f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Thu, 18 Feb 2021 21:53:24 +0100 Subject: [PATCH] VisualEditorDataModule: Use ResourceLoaderContext::encodeJson Follow-up to Iab139c4dd69c9a16c9f4f9e2fd47ec76a9003152. Change-Id: Ia16dad8b6c450f4cb095a67af1c1c2b487e8536b --- includes/VisualEditorDataModule.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/includes/VisualEditorDataModule.php b/includes/VisualEditorDataModule.php index 32f64d6c28..4874cdf3c3 100644 --- a/includes/VisualEditorDataModule.php +++ b/includes/VisualEditorDataModule.php @@ -32,13 +32,11 @@ class VisualEditorDataModule extends ResourceLoaderModule { $plainMessages[ $msgKey ] = $msgObj->plain(); } - return 've.init.platform.addParsedMessages(' . FormatJson::encode( - $parsedMessages, - (bool)ResourceLoader::inDebugMode() + return 've.init.platform.addParsedMessages(' . $context->encodeJson( + $parsedMessages ) . ');' . - 've.init.platform.addMessages(' . FormatJson::encode( - $plainMessages, - (bool)ResourceLoader::inDebugMode() + 've.init.platform.addMessages(' . $context->encodeJson( + $plainMessages ) . ');'; }