diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-02-27 09:19:51 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-02-27 09:19:59 +0100 |
commit | ea4ecf501fc83134db2201477b4cdb1806d5312c (patch) | |
tree | 3f037329e0b7dead6c97fd58182013bc3d097667 /vendor/fguillot/picofeed/lib/PicoFeed/Parser/Atom.php | |
parent | 790f0a0a709510092546c5ca4347bbec5f0a19c2 (diff) |
update picofeed
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; + } } /** |