1
0
Fork 0
forked from blallo/rss-bridge

[Bridge] Support 'dc' namespace for RSS 1.0

This commit is contained in:
logmanoriginal 2016-09-04 13:05:17 +02:00
parent 8fa0b9660f
commit 149b64879e

View file

@ -705,7 +705,16 @@ abstract class RssExpander extends HttpCachingBridgeAbstract {
protected function parseRSS_1_0_Item($feedItem){
// 1.0 adds optional elements around the 0.91 standard
return $this->parseRSS_0_9_1_Item($feedItem);
$item = $this->parseRSS_0_9_1_Item($feedItem);
$namespaces = $feedItem->getNamespaces(true);
if(isset($namespaces['dc'])){
$dc = $feedItem->children($namespaces['dc']);
if(isset($dc->date)) $item['timestamp'] = strtotime($dc->date);
if(isset($dc->creator)) $item['author'] = $dc->creator;
}
return $item;
}
protected function parseRSS_2_0_Item($feedItem){
@ -719,8 +728,7 @@ abstract class RssExpander extends HttpCachingBridgeAbstract {
$namespaces = $feedItem->getNamespaces(true);
if(isset($namespaces['dc'])){
$dc = $feedItem->children($namespaces['dc']);
if(isset($dc->creator))
$item['author'] = $dc->creator;
if(isset($dc->creator)) $item['author'] = $dc->creator;
}
}
return $item;