Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 32691e5

Browse filesBrowse files
committed
[DomCrawler] Catch expected ValueError.
1 parent 6d7c696 commit 32691e5
Copy full SHA for 32691e5

File tree

1 file changed

+2
-2
lines changed
Filter options

1 file changed

+2
-2
lines changed

‎src/Symfony/Component/DomCrawler/Crawler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DomCrawler/Crawler.php
+2-2Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.