Skip to content

Commit 458ba05

Browse files
authored
Merge pull request #1375 from algolia/feature/MAGE-676
Fixed mb_convert_encoding() function deprecated issue in php8.2
2 parents b2e2f67 + 1428bc5 commit 458ba05

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Helper/Entity/PageHelper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ private function strip($s, $completeRemoveTags = [])
196196
if ($completeRemoveTags && $completeRemoveTags !== [] && $s) {
197197
$dom = new \DOMDocument();
198198
libxml_use_internal_errors(true);
199-
$dom->loadHTML(mb_convert_encoding($s, 'HTML-ENTITIES', 'UTF-8'));
199+
$encodedStr = mb_encode_numericentity($s, [0x80, 0x10fffff, 0, ~0]);
200+
$dom->loadHTML($encodedStr);
200201
libxml_use_internal_errors(false);
201202

202203
$toRemove = [];

0 commit comments

Comments
 (0)