Skip to content

Commit 071e847

Browse files
Merge branch '6.0' into 6.1
* 6.0: - - Fix merge Fix merge [HttpKernel] Guard against bad profile data Fix merge [FrameworkBundle] Fix resetting container between tests Fix deprecations on PHP 8.2
2 parents 7b56eee + 9b41269 commit 071e847

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)