Bug 373546. URIs in <guid isPermaLink='false'> are recognized as valid links of feed items in the feed reading view. r=mano

This commit is contained in:
sayrer@gmail.com 2007-04-18 21:50:16 -07:00
parent f5a47a6bb4
commit 9ff21564bb
5 changed files with 81 additions and 1 deletions

View File

@ -481,7 +481,7 @@ Entry.prototype = {
var isPermaLink = true;
if (bagHasKey(guid, "isPermaLink"))
isPermaLink = new Boolean(guid.getProperty("isPermaLink"));
isPermaLink = guid.getProperty("isPermaLink").toLowerCase() != "false";
if (guid && isPermaLink)
this.link = strToURI(guid.getProperty("guid"));

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
Description: item guid should not map to link when isPermaLink=false
Expect: var link = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link; link == null;
-->
<rss version="2.0" >
<channel>
<item>
<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
<title>test</title>
<guid isPermaLink="false">http://www.example.org/</guid>
<category domain="foo">bar</category>
<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
</channel>
</rss>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
Description: item guid should not map to link when isPermaLink=FaLsE
Expect: var link = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link; link == null;
-->
<rss version="2.0" >
<channel>
<item>
<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
<title>test</title>
<guid isPermaLink="FaLsE">http://www.example.org/</guid>
<category domain="foo">bar</category>
<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
</channel>
</rss>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
Description: item guid should map to link when isPermaLink=TrUe
Expect: var link = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link; link.spec == "http://www.example.org/";
-->
<rss version="2.0" >
<channel>
<item>
<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
<title>test</title>
<guid isPermaLink="TrUe">http://www.example.org/</guid>
<category domain="foo">bar</category>
<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
</channel>
</rss>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
Description: item guid should map to link when isPermaLink=meatcake or other unknown values
Expect: var link = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link; link.spec == "http://www.example.org/";
-->
<rss version="2.0" >
<channel>
<item>
<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
<title>test</title>
<guid isPermaLink="meatcake">http://www.example.org/</guid>
<category domain="foo">bar</category>
<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
</channel>
</rss>