Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit5d7b7e9

Browse 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/AThis is#36906 ported to the 4.4 branch.Commits-------32691e5 [DomCrawler] Catch expected ValueError.
2 parentsa25e88b +32691e5 commit5d7b7e9

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
returnmb_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)

[8]ページ先頭

©2009-2025 Movatter.jp