PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » XML » XML_RSS » Bug #3871

Multiple tags skipped; Channel tags lost; Atributes skipped

Details

Submitted2005-03-18 13:30 UTC
Fromnetkot at mail dot ru
Assignedmj
StatusNo Feedback
PackageXML_RSS
PHP Version4.3.10
OSWindows/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 = '';
> }
>