8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent acb2df0 commit 461412cCopy full SHA for 461412c
src/Symfony/Component/DomCrawler/Crawler.php
@@ -148,15 +148,15 @@ public function addHtmlContent($content, $charset = 'UTF-8')
148
$dom->validateOnParse = true;
149
150
if (function_exists('mb_convert_encoding')) {
151
- $has_error = false;
152
- $previous = set_error_handler(function()use(&$has_error){
153
- $has_error = true;
+ $hasError = false;
+ set_error_handler(function()use(&$hasError){
+ $hasError = true;
154
});
155
$tmpContent = @mb_convert_encoding($content, 'HTML-ENTITIES', $charset);
156
157
- set_error_handler($previous);
+ restore_error_handler();
158
159
- if (!$has_error) {
+ if (!$hasError) {
160
$content = $tmpContent;
161
}
162
0 commit comments