Skip to content

Commit 6571e51

Browse files
Merge branch '5.4' into 6.0
* 5.4: Remove former core members from code owners [Form] fix populating single widget time view data with different timezones [DomCrawler][VarDumper] Fix html-encoding emojis
2 parents 9b41269 + a213cbc commit 6571e51

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-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_encode_numericentity($htmlContent, [0x80, 0xFFFF, 0, 0xFFFF], $charset);
1078+
return mb_encode_numericentity($htmlContent, [0x80, 0x10FFFF, 0, 0x1FFFFF], $charset);
10791079
} catch (\Exception|\ValueError $e) {
10801080
try {
10811081
$htmlContent = iconv($charset, 'UTF-8', $htmlContent);
1082-
$htmlContent = mb_encode_numericentity($htmlContent, [0x80, 0xFFFF, 0, 0xFFFF], 'UTF-8');
1082+
$htmlContent = mb_encode_numericentity($htmlContent, [0x80, 0x10FFFF, 0, 0x1FFFFF], 'UTF-8');
10831083
} catch (\Exception|\ValueError $e) {
10841084
}
10851085

Tests/AbstractCrawlerTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,13 @@ public function testHtml()
371371
$this->assertSame('my value', $this->createTestCrawler(null)->filterXPath('//ol')->html('my value'));
372372
}
373373

374+
public function testEmojis()
375+
{
376+
$crawler = $this->createCrawler('<body><p>Hey 👋</p></body>');
377+
378+
$this->assertSame('<body><p>Hey 👋</p></body>', $crawler->html());
379+
}
380+
374381
public function testExtract()
375382
{
376383
$crawler = $this->createTestCrawler()->filterXPath('//ul[1]/li');

0 commit comments

Comments
 (0)