Skip to content

Commit ec7a635

Browse files
authored
Merge pull request #547 from valentin-popov/master
#545 trim comma from encoding value
2 parents 137d9a9 + aa2829e commit ec7a635

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
@@ -30,7 +30,7 @@ public function __construct(Extractor $extractor)
3030
$contentType = $extractor->getResponse()->getHeaderLine('content-type');
3131
preg_match('/charset="?(.*?)(?=$|\s|;|")/i', $contentType, $match);
3232
if (!empty($match[1])) {
33-
$encoding = $match[1];
33+
$encoding = trim($match[1], ',');
3434
} elseif (!empty($html)) {
3535
preg_match('/charset="?(.*?)(?=$|\s|;|")/i', $html, $match);
3636
if (!empty($match[1])) {

0 commit comments

Comments
 (0)