diff options
author | Andrew Dolgov <[email protected]> | 2013-06-01 09:49:56 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-06-01 09:49:56 +0400 |
commit | ce5d234d636bea707b69d0c63192eecdf9e7d1d4 (patch) | |
tree | f5c34b1ead58ff5eed0d899d0a2bde6076a4a802 /classes | |
parent | 67f4fe178099de9744d208ed818f9b6728239f33 (diff) |
support dc:date elements in rss and atom feeds
Diffstat (limited to 'classes')
-rw-r--r-- | classes/feeditem/atom.php | 6 | ||||
-rw-r--r-- | classes/feeditem/rss.php | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/classes/feeditem/atom.php b/classes/feeditem/atom.php index 489c5b148..c9f5b5c62 100644 --- a/classes/feeditem/atom.php +++ b/classes/feeditem/atom.php @@ -16,6 +16,12 @@ class FeedItem_Atom extends FeedItem_Common { if ($updated) { return strtotime($updated->nodeValue); } + + $date = $this->xpath->query("dc:date", $this->elem)->item(0); + + if ($date) { + return strtotime($date->nodeValue); + } } function get_link() { diff --git a/classes/feeditem/rss.php b/classes/feeditem/rss.php index e09a1fbba..e5960243c 100644 --- a/classes/feeditem/rss.php +++ b/classes/feeditem/rss.php @@ -16,6 +16,12 @@ class FeedItem_RSS extends FeedItem_Common { if ($pubDate) { return strtotime($pubDate->nodeValue); } + + $date = $this->xpath->query("dc:date", $this->elem)->item(0); + + if ($date) { + return strtotime($date->nodeValue); + } } function get_link() { |