Skip to content

Commit

Permalink
Update MetadataRetriever.php
Browse files Browse the repository at this point in the history
Added `mb_convert_encoding()` on `$description` + `$tags`, like `$title`
  • Loading branch information
sokai committed May 30, 2023
1 parent 467b28c commit e22e28c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions application/http/MetadataRetriever.php
Expand Up @@ -59,6 +59,12 @@ public function retrieve(string $url): array
if (!empty($title) && strtolower($charset) !== 'utf-8') {
$title = mb_convert_encoding($title, 'utf-8', $charset);
}
if (!empty($description) && strtolower($charset) !== 'utf-8') {
$description = mb_convert_encoding($description, 'utf-8', $charset);
}
if (!empty($tags) && strtolower($charset) !== 'utf-8') {
$tags = mb_convert_encoding($tags, 'utf-8', $charset);
}

return array_map([$this, 'cleanMetadata'], [
'title' => $title,
Expand Down

0 comments on commit e22e28c

Please sign in to comment.