8000 [DomCrawler] Catch expected ValueError. · symfony/symfony@32691e5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 32691e5

Browse files
committed
[DomCrawler] Catch expected ValueError.
1 parent 6d7c696 commit 32691e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/DomCrawler/Crawler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,11 +1204,11 @@ private function convertToHtmlEntities(string $htmlContent, string $charset = 'U
12041204

12051205
try {
12061206
return mb_convert_encoding($htmlContent, 'HTML-ENTITIES', $charset);
1207-
} catch (\Exception $e) {
1207+
} catch (\Exception | \ValueError $e) {
12081208
try {
12091209
$htmlContent = iconv($charset, 'UTF-8', $htmlContent);
12101210
$htmlContent = mb_convert_encoding($htmlContent, 'HTML-ENTITIES', 'UTF-8');
1211-
} catch (\Exception $e) {
1211+
} catch (\Exception | \ValueError $e) {
12121212
}
12131213

12141214
return $htmlContent;

0 commit comments

Comments
 (0)
0