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 #1477

XML_RSS ignores guid tag for links

Details

Submitted2004-05-23 17:57 UTC
Fromjoe at joestump dot net
StatusNo Feedback
PackageXML_RSS
PHP VersionIrrelevant
OSAll
Roadmaps(Not assigned)

Comments

[2004-05-23 17:57 UTC] joe at joestump dot net

Description:
------------
Here is an example item that fails to parse correctly
(despite it being a valid feed according to
feedvalidator.org)

<item>
<title>Cops in the subway</title>
<description>As I walked to the subway through the
crowds in Grand Central Terminal last night, a police
officer yelled out to a young man accompanied by his
mother, "hey, you gotta take that cap off in here!
" The youngster, startled, tugged on the bill of
his Red Sox hat, looked at the now-grinning cop, and
smiled broadly, realizing he&apos;d been had. "
That&apos;s worth a summons around here, ya know,"
the...</description>
<guid isPermaLink="true">http://www.kottke.org/04/05/
cops-in-the-subway</guid>
<pubDate>Sat, 22 May 2004 10:38:16 -0500</pubDate>
</item>

Reproduce code:
---------------
Trying to parse this results in a blank URL.

Expected result:
----------------
guid should be parsed into 'link' if link is empty

[2004-11-22 06:47 UTC] alanmitchell at yahoo dot com

I am having a similar problem as Joe. The array just doesn't seem to contain a GUID, even though there is a GUID in the feed.

Here is an example feed:
http://rss.news.yahoo.com/rss/topstories

Here is sample code:

//begin code
require 'XML/RSS.php';

$feed = "http://rss.news.yahoo.com/rss/topstories";
$rss =& new XML_RSS($feed);
$rss->parse();

foreach ($rss->getItems() as $item)
{
print_r($item);
}

//[end code]

For the first item in the array I get:

Array ( [title] => Bush Vows to Work for 9/11 Bill's Passage (AP) [link] => http://us.rd.yahoo.com/dailynews/rss/topstories/*http://story.news.yahoo.com/news?tmpl=story2&u=/ap/20041122/ap_on_go_co/congress [pubdate] => Mon, 22 Nov 2004 05:37:29 GMT [description] => AP - Unwilling to concede defeat, congressional leaders expressed hope Sunday that lawmakers could return next month to resolve a turf battle that has blocked passage of an overhaul of the nation's intelligence agencies. President Bush pledged to work with them for passage. )

The GUID is missing from all other items, too. Where is it? Am I missing something?

This problem occurs on other feeds that are valid RSS according to the validator. I have not found a feed for which the function will return a GUID.