Skip to content

Commit

Permalink
Merge pull request #553 from marcwieland95/fix-mb_encoding_aliases
Browse files Browse the repository at this point in the history
fix: make sure to pass the correct argument to mb_encoding_aliases()
  • Loading branch information
oscarotero authored Dec 12, 2024
2 parents a66487b + 1b53985 commit 56efec6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(Extractor $extractor)
if (!empty($match[1])) {
$encoding = trim($match[1], ',');
try {
$ret = mb_encoding_aliases($encoding);
$ret = mb_encoding_aliases($encoding ?? '');
if ($ret === false) {
$encoding = null;
}
Expand All @@ -46,7 +46,7 @@ public function __construct(Extractor $extractor)
$encoding = trim($match[1], ',');
}
try {
$ret = mb_encoding_aliases($encoding);
$ret = mb_encoding_aliases($encoding ?? '');
if ($ret === false) {
$encoding = null;
}
Expand Down

0 comments on commit 56efec6

Please sign in to comment.