Avoid false preview image

If the website doesn't provide an og_image, the value will be false and so it'll be saved like that in the database.
We prefer to leave it as null instead of false.
This commit is contained in:
Jeremy Benoist
2017-01-10 17:42:34 +01:00
parent e4ccd3effe
commit 3d71d40349
2 changed files with 42 additions and 1 deletions

View File

@ -88,7 +88,7 @@ class ContentProxy
$entry->setDomainName($domainName);
}
if (isset($content['open_graph']['og_image'])) {
if (isset($content['open_graph']['og_image']) && $content['open_graph']['og_image']) {
$entry->setPreviewPicture($content['open_graph']['og_image']);
}