diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Helper/ContentProxy.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/ContentProxy.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 90d0c50d..8ba77ca9 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php | |||
@@ -82,8 +82,15 @@ class ContentProxy | |||
82 | $entry->setHttpStatus(isset($content['status']) ? $content['status'] : ''); | 82 | $entry->setHttpStatus(isset($content['status']) ? $content['status'] : ''); |
83 | 83 | ||
84 | if (!empty($content['date'])) { | 84 | if (!empty($content['date'])) { |
85 | $date = $content['date']; | ||
86 | |||
87 | // is it a timestamp? | ||
88 | if (filter_var($date, FILTER_VALIDATE_INT) !== false) { | ||
89 | $date = '@'.$content['date']; | ||
90 | } | ||
91 | |||
85 | try { | 92 | try { |
86 | $entry->setPublishedAt(new \DateTime($content['date'])); | 93 | $entry->setPublishedAt(new \DateTime($date)); |
87 | } catch (\Exception $e) { | 94 | } catch (\Exception $e) { |
88 | $this->logger->warning('Error while defining date', ['e' => $e, 'url' => $url, 'date' => $content['date']]); | 95 | $this->logger->warning('Error while defining date', ['e' => $e, 'url' => $url, 'date' => $content['date']]); |
89 | } | 96 | } |