diff options
Diffstat (limited to 'vendor/fguillot/picofeed/lib/PicoFeed/Parser/Atom.php')
-rw-r--r-- | vendor/fguillot/picofeed/lib/PicoFeed/Parser/Atom.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Atom.php b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Atom.php index 9f2f108d8..21566527e 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Atom.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Atom.php @@ -131,7 +131,7 @@ class Atom extends Parser */ public function findFeedDate(SimpleXMLElement $xml, Feed $feed) { - $feed->date = $this->date->getTimestamp((string) $xml->updated); + $feed->date = $this->date->getDateTime((string) $xml->updated); } /** @@ -143,10 +143,15 @@ class Atom extends Parser */ public function findItemDate(SimpleXMLElement $entry, Item $item) { - $published = isset($entry->published) ? $this->date->getTimestamp((string) $entry->published) : 0; - $updated = isset($entry->updated) ? $this->date->getTimestamp((string) $entry->updated) : 0; + $published = isset($entry->published) ? $this->date->getDateTime((string) $entry->published) : null; + $updated = isset($entry->updated) ? $this->date->getDateTime((string) $entry->updated) : null; - $item->date = max($published, $updated) ?: time(); + if ($published !== null && $updated !== null) { + $item->date = max($published, $updated); + } + else { + $item->date = $updated ?: $published; + } } /** |