resourceloader: Avoid escaping of UTF-8 characters in messages
authorFomafix <fomafix@googlemail.com>
Tue, 30 Jul 2019 04:52:59 +0000 (06:52 +0200)
committerFomafix <fomafix@googlemail.com>
Thu, 1 Aug 2019 09:29:42 +0000 (11:29 +0200)
It's not needed to escape UTF-8 characters in messages.

The characters '&', '<' and '>' are still escaped. For the output in
load.php this escaping is not necessary but messages can also embedded
into <script> tags and here are the characters '<' and '>' problematic.

Bug: T229301
Change-Id: If424a21df4a813ba6cb79b939f0857d96f162a17

includes/resourceloader/MessageBlobStore.php

index fca06c9..d0f6729 100644 (file)
@@ -224,7 +224,7 @@ class MessageBlobStore implements LoggerAwareInterface {
                        }
                }
 
-               $json = FormatJson::encode( (object)$messages );
+               $json = FormatJson::encode( (object)$messages, false, FormatJson::UTF8_OK );
                // @codeCoverageIgnoreStart
                if ( $json === false ) {
                        $this->logger->warning( 'Failed to encode message blob for {module} ({lang})', [