Closed
Bug 450541
Opened 17 years ago
Closed 15 years ago
Atom <title type="html"> should have HTML entities and numeric character references replaced
Categories
(MailNews Core :: Feed Reader, defect)
MailNews Core
Feed Reader
Tracking
(Not tracked)
RESOLVED
FIXED
Thunderbird 5.0b1
People
(Reporter: philor, Assigned: alta88)
References
Details
Attachments
(2 files, 2 obsolete files)
|
866 bytes,
patch
|
standard8
:
review+
|
Details | Diff | Splinter Review |
|
14.22 KB,
patch
|
Details | Diff | Splinter Review |
Although we correctly don't resolve double-escaped entities and NCRs in RSS titles (bug 277243), we incorrectly don't resolve them in Atom titles with type="html" - FeedParser.xmlUnescape() resolves >, <, and &, rather than everything from ’ to ’
The ideal way of fixing it would be to switch entirely to using the toolkit feed parsing service; a reasonable alternative would be to use its nsIScriptableUnescapeHTML service.
Flags: wanted-thunderbird3+
Attachment #524078 -
Flags: review?(bugzilla)
Updated•15 years ago
|
Assignee: nobody → alta88
Status: NEW → ASSIGNED
Comment 3•15 years ago
|
||
Comment on attachment 524078 [details] [diff] [review]
tired of the bad subjects..
Sorry for the delay in getting to this, do you have an example feed I could verify this on?
I think also we should be considering getting unit tests (probably via mozmill, but maybe xpcshell if feeds support it), for this, so that we can help to ensure stability for feeds in future. I'm willing to help you form some basic tests if you need it.
>diff --git a/mailnews/extensions/newsblog/content/FeedItem.js b/mailnews/extensions/newsblog/content/FeedItem.js
>+ var unescapeHTML = Components.classes["@mozilla.org/feed-unescapehtml;1"].
>+ getService(Components.interfaces.nsIScriptableUnescapeHTML);
>+ title = unescapeHTML.unescape(title);
Nit: might as well just make this:
Components.classes["@mozilla.org/feed-unescapehtml;1"]
.getService(Components.interfaces.nsIScriptableUnescapeHTML)
.unescape(title);
Note that we tend to prefer having the dot at the start of the line for mailnews items.
a sample feed might be:
http://www.nakedcapitalism.com/feed/atom
if there is an existing test for feeds you can point me to, i can adapt it for this small change. i think it would be a bit of a curve though if this change were to start new tests for feeds, as i have no familiarity with them.
Attachment #524078 -
Attachment is obsolete: true
Attachment #524078 -
Flags: review?(mbanner)
Attachment #528403 -
Flags: review?(mbanner)
Attachment #528403 -
Attachment is patch: true
Attachment #528403 -
Attachment mime type: text/x-patch → text/plain
Comment 5•15 years ago
|
||
Ok, I told you wrong. It should have been title = ...
Attachment #528403 -
Attachment is obsolete: true
Attachment #529653 -
Flags: review+
Attachment #528403 -
Flags: review?(mbanner)
Comment 6•15 years ago
|
||
I did start writing a test, but got stuck with how to select account central. I'm putting this here so that hopefully someone with a bit more time can pick it up, I'll post on the newsgroup about it.
However, I'm happy that the main patch can land without this.
Updated•15 years ago
|
Flags: in-testsuite?
Comment 7•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 3.3a4
Comment 8•15 years ago
|
||
(In reply to comment #7)
> Checked in: http://hg.mozilla.org/comm-central/rev/bdd02cca51f5
http://hg.mozilla.org/releases/comm-2.0/rev/8800391a9c4a
Updated•11 years ago
|
Flags: in-testsuite?
You need to log in
before you can comment on or make changes to this bug.
Description
•