There was an error while loading. Please reload this page.
2 parents edf3723 + 19f3521 commit 72589d2Copy full SHA for 72589d2
src/Document.php
@@ -190,7 +190,7 @@ public function getEncoding(): ?string {
190
private function getCharset(string $html): ?string {
191
$charset = null;
192
193
- if (preg_match('@<meta.*?charset=["\']?([^"\'\s>]+)@im', $html, $matches)) {
+ if (preg_match('@<meta[^>]*?charset=["\']?([^"\'\s>]+)@im', $html, $matches)) {
194
$charset = mb_strtoupper($matches[1]);
195
}
196
0 commit comments