Skip to content

Commit

Permalink
b_convert_encoding(): Handling HTML entities via mbstring is deprecat…
Browse files Browse the repository at this point in the history
…ed; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead
  • Loading branch information
escopecz committed Dec 21, 2023
1 parent f54e165 commit 7902f0f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function decodeTokens(PageDisplayEvent $event): void

// replace slots
$dom = new \DOMDocument('1.0', 'utf-8');
$dom->loadHTML(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'), LIBXML_NOERROR);
$dom->loadHTML(mb_encode_numericentity($content, [0x80, 0x10ffff, 0, 0xfffff], 'UTF-8'), LIBXML_NOERROR);
$xpath = new \DOMXPath($dom);

$divContent = $xpath->query('//*[@data-slot="dwc"]');
Expand Down

0 comments on commit 7902f0f

Please sign in to comment.