Skip to content

Commit 346e2ea

Browse files
committed
Ignore ; or space after charset in meta tag
1 parent 7486765 commit 346e2ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PHPHtmlParser/Dom.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ protected function detectCharset()
633633
return false;
634634
}
635635
$matches = [];
636-
if (preg_match('/charset=(.+)/', $content, $matches)) {
636+
if (preg_match('/charset=([^; ]+)/', $content, $matches)) {
637637
$encode->from(trim($matches[1]));
638638
$this->root->propagateEncoding($encode);
639639

0 commit comments

Comments
 (0)