Skip to content

Commit c0bda97

Browse files
Merge branch '4.4' into 5.4
* 4.4: [HttpKernel] Guard against bad profile data Fix deprecations on PHP 8.2
2 parents 50777f4 + 4e9215a commit c0bda97

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
@@ -1186,11 +1186,11 @@ private function convertToHtmlEntities(string $htmlContent, string $charset = 'U
11861186
set_error_handler(function () { throw new \Exception(); });
11871187

11881188
try {
1189-
return mb_convert_encoding($htmlContent, 'HTML-ENTITIES', $charset);
1189+
return mb_encode_numericentity($htmlContent, [0x80, 0xFFFF, 0, 0xFFFF], $charset);
11901190
} catch (\Exception|\ValueError $e) {
11911191
try {
11921192
$htmlContent = iconv($charset, 'UTF-8', $htmlContent);
1193-
$htmlContent = mb_convert_encoding($htmlContent, 'HTML-ENTITIES', 'UTF-8');
1193+
$htmlContent = mb_encode_numericentity($htmlContent, [0x80, 0xFFFF, 0, 0xFFFF], 'UTF-8');
11941194
} catch (\Exception|\ValueError $e) {
11951195
}
11961196

0 commit comments

Comments
 (0)