Home » XML » XML_RSS » Bug #3871
Multiple tags skipped; Channel tags lost; Atributes skipped
Details
| Submitted | 2005-03-18 13:30 UTC |
|---|---|
| From | netkot at mail dot ru |
| Assigned | mj |
| Status | No Feedback |
| Package | XML_RSS |
| PHP Version | 4.3.10 |
| OS | Windows/Unix |
| Roadmaps | (Not assigned) |
Comments
[2005-03-18 13:30 UTC] netkot at mail dot ru
Description:
------------
Tags 'category' and 'enclosure' could be multiple. Parser takes only the first ones.
After the image-tag in the channel-tag there could be several other tags, which are not taken (lastBuildDate, language, ttl and so) - see the code.
And the tags with attibutes are not taken, such as 'enclosure'.
Is it planned to make the class supporting RSS 2.0?
Reproduce code:
---------------
<?xml version="1.0" encoding="windows-1251"?>
<rss xmlns="http://backend.userland.com/rss2" xmlns:yandex="http://news.yandex.ru" version="2.0">
<channel>
<title>ÂèíÒÀ</title>
<link>http://www.vinta.info/</link>
<description>ëåíòà íîâîñòåé</description>
<image>
<url>http://www.vinta.info/_data/objects/00001/site_logo.gif</url>
<link>http://www.vinta.info/</link>
<title>Âîëæñêîå èíôîðìàöèîííîå òåëåãðàôíîå àãåíòñòâî ÂèíÒÀ</title>
</image>
<lastBuildDate>Fri, 18 Mar 2005 13:21:34 +0300</lastBuildDate>
<language>ru-ru</language>
<ttl>60</ttl>
<generator>TreeGraph 3.6 (tm) http://treegraph.nino.ru/</generator>
<item>
<title>×åðíóþ äûðó â ëàáîðàòîðíûõ óñëîâèÿõ ñîçäàëè àìåðèêàíñêèå ó÷åíûå</title>
<link>http://www.vinta.info/?id=15044</link>
<description>Åå òåìïåðàòóðà â 300 ìèëëèîíîâ ðàç ïðåâûñèëà òåìïåðàòóðó Ñîëíöà</description>
<pubDate>Fri, 18 Mar 2005 11:06:00 +0300</pubDate>
<category>ÎÁÙÅÑÒÂÎ</category>
<category>ÏÎËÈÒÈÊÀ</category>
<enclosure url="http://www.vinta.info/_data/objects/15044/icon.jpg" type="image/jpeg"/>
<enclosure url="http://www.vinta.info/_data/objects/15044/view_icon_photo.jpg" type="image/jpeg"/>
</item>
</channel>
</rss>
[2005-05-25 11:15 UTC] alex at waste dot me dot uk
This package appears to be aging quite rapidly, perhaps
it needs a new maintainer?
I wrote a quick patch to add support for enclosures for
a project I'm doing:
67a68,73
> var $attribs = array();
>
>
> /**
> * @var array
> */
94c100
< var $itemTags = array('TITLE', 'LINK',
'DESCRIPTION', 'PUBDATE');
---
> var $itemTags = array('TITLE', 'LINK',
'DESCRIPTION', 'PUBDATE', 'ENCLOSURE');
162a169,172
> case 'ENCLOSURE':
> $this->attribs = $attribs;
> break;
>
196a207,213
> if ($element == 'ENCLOSURE') {
> $this->item['enclosure']['url'] = $this-
>attribs['URL'];
> $this->item['enclosure']['type'] = $this-
>attribs['TYPE'];
> $this->item['enclosure']['length'] =
$this->attribs['LENGTH'];
> $this->attribs = '';
> }
>