]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Helper/ContentProxy.php
Added publication date
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Helper / ContentProxy.php
index 0130bd2b21ccc7474db07994f26d7dbd14fafa34..5635866530def1643bcacbe987c2bb3ddbc95b4a 100644 (file)
@@ -79,6 +79,10 @@ class ContentProxy
         $entry->setContent($html);
         $entry->setHttpStatus(isset($content['status']) ? $content['status'] : '');
 
+        if (isset($content['date']) && null !== $content['date']) {
+            $entry->setPublishedAt(new \DateTime($content['date']));
+        }
+
         $entry->setLanguage(isset($content['language']) ? $content['language'] : '');
         $entry->setMimetype(isset($content['content_type']) ? $content['content_type'] : '');
         $entry->setReadingTime(Utils::getReadingTime($html));
@@ -88,7 +92,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']);
         }