Skip to content

Commit

Permalink
Merge pull request #546 from valentin-popov/master
Browse files Browse the repository at this point in the history
trim comma from encoding value
  • Loading branch information
oscarotero authored Nov 7, 2024
2 parents 1d6aa33 + c6eecb7 commit 137d9a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(Extractor $extractor)
} elseif (!empty($html)) {
preg_match('/charset="?(.*?)(?=$|\s|;|")/i', $html, $match);
if (!empty($match[1])) {
$encoding = $match[1];
$encoding = trim($match[1], ',');
}
}
$this->document = !empty($html) ? Parser::parse($html, $encoding) : new DOMDocument();
Expand Down

0 comments on commit 137d9a9

Please sign in to comment.