Merge pull request #10743 from annando/warning

Avoid warning when fetching page data
This commit is contained in:
Hypolite Petovan 2021-09-22 07:47:57 -04:00 committed by GitHub
commit c9e30ac2c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1116,7 +1116,11 @@ class ParseUrl
}
$content = JsonLD::fetchElement($jsonld, 'image', 'url', '@type', 'ImageObject');
if (!empty($content)) {
if (!empty($content) && !is_string($content)) {
Logger::notice('Unexpected return value for the author image', ['content' => $content]);
}
if (!empty($content) && is_string($content)) {
$jsonldinfo['author_img'] = trim($content);
}