diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-11-19 12:16:15 -0500 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-11-19 12:16:15 -0500 |
commit | ee22b2ccf9819cefba54ef38c6a57829c7d3fa73 (patch) | |
tree | dcb383614008f15dae1310620469ac95e9fcdc0d /lib/rssaction.php | |
parent | 4463768baed036b487d473a60b30f0c314ee1673 (diff) |
tobyink's RDF compatibility patch
Diffstat (limited to 'lib/rssaction.php')
-rw-r--r-- | lib/rssaction.php | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/rssaction.php b/lib/rssaction.php index cd4c8b51c..3b303f73e 100644 --- a/lib/rssaction.php +++ b/lib/rssaction.php @@ -270,14 +270,7 @@ class Rss10Action extends Action foreach($attachments as $attachment){ $enclosure=$attachment->getEnclosure(); if ($enclosure) { - // DO NOT move xmlns declaration to root element. Making it - // the default namespace here improves compatibility with - // real-world feed readers. - $attribs = array( - 'rdf:resource' => $enclosure->url, - 'url' => $enclosure->url, - 'xmlns' => 'http://purl.oclc.org/net/rss_2.0/enc#' - ); + $attribs = array('rdf:resource' => $enclosure->url); if ($enclosure->title) { $attribs['dc:title'] = $enclosure->title; } @@ -285,12 +278,12 @@ class Rss10Action extends Action $attribs['dc:date'] = common_date_w3dtf($enclosure->modified); } if ($enclosure->size) { - $attribs['length'] = $enclosure->size; + $attribs['enc:length'] = $enclosure->size; } if ($enclosure->mimetype) { - $attribs['type'] = $enclosure->mimetype; + $attribs['enc:type'] = $enclosure->mimetype; } - $this->element('enclosure', $attribs); + $this->element('enc:enclosure', $attribs); } $this->element('sioc:links_to', array('rdf:resource'=>$attachment->url)); } @@ -358,6 +351,8 @@ class Rss10Action extends Action 'http://commontag.org/ns#', 'xmlns:foaf' => 'http://xmlns.com/foaf/0.1/', + 'xmlns:enc' => + 'http://purl.oclc.org/net/rss_2.0/enc#', 'xmlns:sioc' => 'http://rdfs.org/sioc/ns#', 'xmlns:sioct' => |