Skip to content

Commit 137d9a9

Browse files
authored
Merge pull request #546 from valentin-popov/master
trim comma from encoding value
2 parents 1d6aa33 + c6eecb7 commit 137d9a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Document.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(Extractor $extractor)
3434
} elseif (!empty($html)) {
3535
preg_match('/charset="?(.*?)(?=$|\s|;|")/i', $html, $match);
3636
if (!empty($match[1])) {
37-
$encoding = $match[1];
37+
$encoding = trim($match[1], ',');
3838
}
3939
}
4040
$this->document = !empty($html) ? Parser::parse($html, $encoding) : new DOMDocument();

0 commit comments

Comments
 (0)