Skip to content

Commit 81f2312

Browse files
committed
Merge remote-tracking branch 'origin/1.2.0-release' into PB-261-120
2 parents c052306 + db5188f commit 81f2312

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/code/Magento/PageBuilder/Model/Stage/HtmlFilter.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ public function __construct(
4040
*/
4141
public function filterHtml(string $content): string
4242
{
43-
$dom = new \DOMDocument();
43+
$dom = new \DOMDocument('1.0', 'UTF-8');
4444
try {
4545
//this code is required because of https://bugs.php.net/bug.php?id=60021
4646
$previous = libxml_use_internal_errors(true);
47-
$dom->loadHTML($content, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
47+
$string = mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8');
48+
$dom->loadHTML($string, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
4849
} catch (\Exception $e) {
4950
$this->loggerInterface->critical($e->getMessage());
5051
}

0 commit comments

Comments
 (0)