Skip to content

Commit 9b41269

Browse files
Merge branch '5.4' into 6.0
* 5.4: Fix merge [HttpKernel] Guard against bad profile data Fix deprecations on PHP 8.2
2 parents d2a5d2b + c0bda97 commit 9b41269

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Crawler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,11 +1075,11 @@ private function convertToHtmlEntities(string $htmlContent, string $charset = 'U
10751075
set_error_handler(function () { throw new \Exception(); });
10761076

10771077
try {
1078-
return mb_convert_encoding($htmlContent, 'HTML-ENTITIES', $charset);
1078+
return mb_encode_numericentity($htmlContent, [0x80, 0xFFFF, 0, 0xFFFF], $charset);
10791079
} catch (\Exception|\ValueError $e) {
10801080
try {
10811081
$htmlContent = iconv($charset, 'UTF-8', $htmlContent);
1082-
$htmlContent = mb_convert_encoding($htmlContent, 'HTML-ENTITIES', 'UTF-8');
1082+
$htmlContent = mb_encode_numericentity($htmlContent, [0x80, 0xFFFF, 0, 0xFFFF], 'UTF-8');
10831083
} catch (\Exception|\ValueError $e) {
10841084
}
10851085

0 commit comments

Comments
 (0)