Merge pull request #10743 from annando/warning

Avoid warning when fetching page data
pull/10753/head
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
1 changed files with 5 additions and 1 deletions

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);
}