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 5d7b7e9

Browse filesBrowse files
bug #36915 [DomCrawler] Catch expected ValueError (derrabus)
This PR was merged into the 4.4 branch. Discussion ---------- [DomCrawler] Catch expected ValueError | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #36872 | License | MIT | Doc PR | N/A This is #36906 ported to the 4.4 branch. Commits ------- 32691e5 [DomCrawler] Catch expected ValueError.
2 parents a25e88b + 32691e5 commit 5d7b7e9
Copy full SHA for 5d7b7e9

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.