Skip to content

Commit 0839c79

Browse files
authored
Merge pull request #205 from magento-gl/AC-7807
AC-7807::Need to fix encoding and decoding issue with same fix which …
2 parents d23cfbc + 7c3bd29 commit 0839c79

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/code/Magento/PageBuilder/Model/Filter/Template.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,10 @@ function ($errorNumber, $errorString) {
170170
throw new DOMException($errorString, $errorNumber);
171171
}
172172
);
173+
$convmap = [0x80, 0x10FFFF, 0, 0x1FFFFF];
173174
$string = mb_encode_numericentity(
174175
$html,
175-
['HTML-ENTITIES','','',''],
176+
$convmap,
176177
'UTF-8'
177178
);
178179
try {

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ public function filterHtml(string $content): string
4646
//this code is required because of https://bugs.php.net/bug.php?id=60021
4747
$previous = libxml_use_internal_errors(true);
4848
$content = '<div>' . $content . '</div>';
49+
$convmap = [0x80, 0x10FFFF, 0, 0x1FFFFF];
4950
$string = mb_encode_numericentity(
5051
$content,
51-
['HTML-ENTITIES','','',''],
52+
$convmap,
5253
'UTF-8'
5354
);
5455
$dom->loadHTML($string, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);

0 commit comments

Comments
 (0)