Fix: synchronous metadata retrieval is failing in strict mode
Metadata can now only be string or null. Fixes #1653
This commit is contained in:
parent
e4b8330e45
commit
6a3a78d023
3 changed files with 9 additions and 4 deletions
application/http
|
@ -60,10 +60,15 @@ class MetadataRetriever
|
|||
$title = mb_convert_encoding($title, 'utf-8', $charset);
|
||||
}
|
||||
|
||||
return [
|
||||
return array_map([$this, 'cleanMetadata'], [
|
||||
'title' => $title,
|
||||
'description' => $description,
|
||||
'tags' => $tags,
|
||||
];
|
||||
]);
|
||||
}
|
||||
|
||||
protected function cleanMetadata($data): ?string
|
||||
{
|
||||
return !is_string($data) || empty(trim($data)) ? null : trim($data);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue