Skip to content

Commit

Permalink
trim comma from encoding value
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin Popov committed Nov 7, 2024
1 parent 1d6aa33 commit c6eecb7
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 c6eecb7

Please sign in to comment.