[BUGFIX] EXT:form - Fix utf-8 encoding for error message 04/44704/3
authorStano Paska <stano.paska@gmail.com>
Fri, 13 Nov 2015 12:48:16 +0000 (13:48 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Fri, 13 Nov 2015 19:29:41 +0000 (20:29 +0100)
This patchset fixes a problem with the error message. As soon as the
message contains utf-8 characters, they are not properly displayed.

Resolves: #71557
Releases: master
Change-Id: I18dfb0862e89680f69f35ae6437bad5f808c7569
Reviewed-on: https://review.typo3.org/44704
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Bjoern Jacob <bjoern.jacob@tritum.de>
Tested-by: Bjoern Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/form/Classes/Utility/CompatibilityLayerUtility.php

index e1646bc..4161765 100644 (file)
@@ -658,7 +658,7 @@ class CompatibilityLayerUtility
         $libxmlUseInternalErrors = libxml_use_internal_errors(true);
         $dom = new \DOMDocument('1.0', 'utf-8');
         $dom->preserveWhiteSpace = false;
-        if (!$dom->loadHTML($html)) {
+        if (!$dom->loadHTML('<?xml encoding="utf-8">' . $html)) {
             libxml_use_internal_errors($libxmlUseInternalErrors);
             return array(
                 'html' => '',