Closed Bug 241228 Opened 20 years ago Closed 20 years ago

RDF misparses Entities

Categories

(Core Graveyard :: RDF, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 231548

People

(Reporter: Biesinger, Unassigned)

Details

RDF seems to decode entities twice, resulting in incorrect behaviour.

TESTCASE:
o) Find downloads.rdf in your profile
o) Change (say) the NC:StatusText attribute of one download to something like
"Test: &"
o) For extra fun, use ", expecting " being displayed.

Start Mozilla. Note that the status text is displayed as "Test: &", instead of
the expected "Test: &"

I suspect this bug is caused by the fact that a) Expat parses the entity,
replacing & with & in the above example; then b) The code in 
rdf/base/src/nsRDFParserUtils.cpp (EntityToUnicode) does the same.


It seems somewhat doubtful to me that this is indeed the desired behaviour.

and in fact, it breaks roundtripping:

change
xpfe/components/download-manager/resources/locale/en-US/downloadmanager.properties
- for example, add & after "Canceled"
make chrome, run mozilla, start and cancel a download

Take note of the text in download manager: "Canceled&" like in the
.properties file

Exit Mozilla. Look at downloads.rdf. Note that the text now has an additional
amp; as expected and desired (the first & was escaped).
=> Serialization works correctly

Run Mozilla, look at download manager. Note that one amp; is now gone.

*** This bug has been marked as a duplicate of 231548 ***
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
hmm, indeed.
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.