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 e9f49ce commit 2311cf6Copy full SHA for 2311cf6
src/Symfony/Component/DomCrawler/Crawler.php
@@ -1170,7 +1170,7 @@ private function supportsEncoding(string $encoding): bool
1170
1171
private function parseXhtml(string $htmlContent, string $charset = 'UTF-8'): \DOMDocument
1172
{
1173
- if ('UTF-8' === $charset && 1 === preg_match('//u', $htmlContent)) {
+ if ('UTF-8' === $charset && preg_match('//u', $htmlContent)) {
1174
$htmlContent = '<?xml encoding="UTF-8">'.$htmlContent;
1175
} else {
1176
$htmlContent = $this->convertToHtmlEntities($htmlContent, $charset);
0 commit comments