forked from blallo/rss-bridge
[Bridge] Support 'dc' namespace for RSS 1.0
This commit is contained in:
parent
8fa0b9660f
commit
149b64879e
1 changed files with 11 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue