Closed Bug 271045 Opened 20 years ago Closed 20 years ago

Thunderbird rejects valid atom feeds

Categories

(MailNews Core :: Feed Reader, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mrbkap, Assigned: mrbkap)

References

()

Details

Attachments

(1 file)

The regular expressions used in determining the type of feed that Thunderbird
can possibly reject valid atom feeds (and also possibly RSS feeds).

In particular, in mozilla/mail/extensions/newsblog/content/Feed.js, starting on
line 188 uses regular expressions of the form: this.responseText.search(/="

The problem with this regular expression is that both apostrophes (') and quotes
(") can be used to denote attribute values in XML, so in the feed: <feed
xmlns='http://purl.org/atom/ns#'> the regular expression fails.

The easy fix for this would be to make the regular expressions use |["']| in
place of |"|, which would accept and parse all valid atom and RSS feeds (note
that the quotation mark at the end of the value can also be |'| or |"|. 

I think a more robust fix would be to inspect the DOM of the incoming feed and
check to see if the first element is <feed> or <rss>. This would allow
not-quite-valid (since atom seems to require a namespace) feeds to be parsed
correctly; however, I'm not very familiar with this code, so I'm not certain of
the feasibility of this approach.
Attached patch patch v1Splinter Review
Taking since I've now made a patch. This seems to work for me (but I hacked my
Thunderbird .9, so this is technically an untested patch, since I had to pull a
new copy of the file).
Assignee: mscott → mrbkap
Status: NEW → ASSIGNED
Comment on attachment 167402 [details] [diff] [review]
patch v1

Looking for r=. Does this need sr=? If not, once it has r=, can it just be
checked in?
Attachment #167402 - Flags: review?(mscott)
this is a very low risk fix with clear verification steps agains the livejournal
test feeds.

Target Milestone: --- → Thunderbird1.0
Attachment #167402 - Flags: review?(mscott) → review+
fixed trunk and branch
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Verified with Windows build 2004-12-03-06-0.9

the feed is added as expected
Status: RESOLVED → VERIFIED
Component: RSS → Feed Reader
Product: Thunderbird → MailNews Core
Target Milestone: Thunderbird1.0 → ---
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: