Bug 297569 - "Subscription hangs indefinitely on "Verifying feed" when <link> is empty" [p=bugzilla.mozilla.org-1@chsc.dk (Christian Schmidt) r=philor]
git-svn-id: svn://10.0.0.236/trunk@242282 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
817ec0a89b
commit
5d9db55b68
@ -196,7 +196,7 @@ FeedItem.prototype =
|
||||
this.content = content; // XXX store it elsewhere, f.e. this.page
|
||||
this.writeToFolder();
|
||||
}
|
||||
else if (this.feed.quickMode)
|
||||
else if (this.feed.quickMode || !this.mURL)
|
||||
{
|
||||
debug(this.identity + " in quick mode; storing");
|
||||
|
||||
@ -256,7 +256,7 @@ FeedItem.prototype =
|
||||
// Backward compatibility: we might have stored this item before isStoredWithId
|
||||
// has been turned on for RSS 2.0 (bug 354345). Check whether this item has been
|
||||
// stored with its URL.
|
||||
if (!downloaded && itemURI != this.mURL)
|
||||
if (!downloaded && this.mURL && itemURI != this.mURL)
|
||||
{
|
||||
itemResource = rdf.GetResource(this.mURL);
|
||||
downloaded = ds.GetTarget(itemResource, FZ_STORED, true);
|
||||
@ -302,7 +302,7 @@ FeedItem.prototype =
|
||||
// Backward compatibility: we might have stored this item before isStoredWithId
|
||||
// has been turned on for RSS 2.0 (bug 354345). Check whether this item has been
|
||||
// stored with its URL.
|
||||
if (!ds.GetTarget(resource, FZ_STORED, true) && itemURI != this.mURL)
|
||||
if (!ds.GetTarget(resource, FZ_STORED, true) && this.mURL && itemURI != this.mURL)
|
||||
resource = rdf.GetResource(this.mURL);
|
||||
|
||||
if (!ds.HasAssertion(resource, FZ_FEED, rdf.GetResource(this.feed.url), true))
|
||||
|
||||
@ -134,11 +134,11 @@ FeedParser.prototype =
|
||||
{
|
||||
guid = getNodeValue(guidNode);
|
||||
isPermaLink = guidNode.getAttribute('isPermaLink') == 'false' ? false : true;
|
||||
item.id = guid;
|
||||
item.isStoredWithId = true;
|
||||
}
|
||||
|
||||
item.isStoredWithId = true;
|
||||
item.url = link ? link : (guid && isPermaLink) ? guid : null;
|
||||
item.id = guid;
|
||||
item.description = getNodeValue(this.childrenByTagNameNS(itemNode, nsURI, "description")[0]);
|
||||
item.title = getNodeValue(this.childrenByTagNameNS(itemNode, nsURI, "title")[0])
|
||||
|| (item.description ? (this.stripTags(item.description).substr(0, 150)) : null)
|
||||
@ -151,7 +151,10 @@ FeedParser.prototype =
|
||||
item.date = getNodeValue(this.childrenByTagNameNS(itemNode, nsURI, "pubDate")[0]
|
||||
|| this.childrenByTagNameNS(itemNode, DC_NS, "date")[0])
|
||||
|| item.date;
|
||||
|
||||
|
||||
if (!item.id)
|
||||
item.id = item.feed.url + '#' + (item.date || item.title);
|
||||
|
||||
// If the date is invalid, users will see the beginning of the epoch
|
||||
// unless we reset it here, so they'll see the current time instead.
|
||||
// This is typical aggregator behavior.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user