We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c052306 + db5188f commit 81f2312Copy full SHA for 81f2312
app/code/Magento/PageBuilder/Model/Stage/HtmlFilter.php
@@ -40,11 +40,12 @@ public function __construct(
40
*/
41
public function filterHtml(string $content): string
42
{
43
- $dom = new \DOMDocument();
+ $dom = new \DOMDocument('1.0', 'UTF-8');
44
try {
45
//this code is required because of https://bugs.php.net/bug.php?id=60021
46
$previous = libxml_use_internal_errors(true);
47
- $dom->loadHTML($content, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
+ $string = mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8');
48
+ $dom->loadHTML($string, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
49
} catch (\Exception $e) {
50
$this->loggerInterface->critical($e->getMessage());
51
}
0 commit comments