Skip to content

Commit

Permalink
Merge pull request #234 from Recras/master
Browse files Browse the repository at this point in the history
Replace functionality that's deprecated in PHP 8.2
  • Loading branch information
stof authored Sep 12, 2022
2 parents 4ab4fe4 + 293ec22 commit 4348a3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CssToInlineStyles.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected function createDomDocumentFromHtml($html)
{
$document = new \DOMDocument('1.0', 'UTF-8');
$internalErrors = libxml_use_internal_errors(true);
$document->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'));
$document->loadHTML(mb_encode_numericentity($html, [0x80, 0xFFFF, 0, 0xFFFF], 'UTF-8'));
libxml_use_internal_errors($internalErrors);
$document->formatOutput = true;

Expand Down

1 comment on commit 4348a3a

@jstanden
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This munges utf8mb4 bytes in a string (4-byte emoji like 🧮)

Please sign in to comment.