Closed
Bug 109530
Opened 23 years ago
Closed 23 years ago
xml.cgi double (and in some cases triple) quoting special characters.
Categories
(Bugzilla :: Bugzilla-General, defect, P2)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.16
People
(Reporter: jacob, Assigned: jacob)
Details
Attachments
(1 file, 1 obsolete file)
3.27 KB,
patch
|
justdave
:
review+
luis
:
review+
|
Details | Diff | Splinter Review |
This is caused by the fact that Bug.pm runs some fields through QuoteXMLChars() or html_quote() when it populates its hash and then runs them through QuoteXMLChars() again when it outputs the XML in emitXML(). Bug.pm's hash of values should not quote the data in any way. It should provide "raw" data that can be quoted depending on the needs of the caller, not just arbitrarily html/xml quoted. Also, QuoteXMLChars() has a bug in it in that the order it quotes can cause the & to get quoted again (making it triple quoted).
Assignee | ||
Comment 1•23 years ago
|
||
Assignee | ||
Comment 2•23 years ago
|
||
I'd like to see this get fixed soon as I'm working on making ssdbot use xml.cgi to retrieve single bugs instead of buglist.cgi (avoiding the shadow database and funny html parsing madness).
Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Comment 3•23 years ago
|
||
Jake, take a look at my patches to buglist.cgi in bug 103778. They include support for outputting query results as RDF (a form of structured XML).
Assignee | ||
Comment 4•23 years ago
|
||
Myk, I remember seeing that :) I do intend to start working on using that facility once it's available for the query interface... however, I'll probably still want to use xml.cgi (or similar) for single bug lookups as it allows me to not be hindered by the shadow database (esp. for when bzbot reports new bugs and wants ssdbot to be able to look them up :)
Comment 5•23 years ago
|
||
You've made these changes to remove the quoting - but presumably some consumer of the info was expecting a quoted version. Do you not need to add these calls back in somewhere else, e.g. in a template? Gerv
Assignee | ||
Comment 6•23 years ago
|
||
The only place that Bug.pm is used is with regards to the moving code. This fixes the other half of moving to not double-unquote (as XML::Parser does the first unquote).
Attachment #57375 -
Attachment is obsolete: true
Comment 7•23 years ago
|
||
We are currently trying to wrap up Bugzilla 2.16. We are now close enough to release time that anything that wasn't already ranked at P1 isn't going to make the cut. Thus this is being retargetted at 2.18. If you strongly disagree with this retargetting, please comment, however, be aware that we only have about 2 weeks left to review and test anything at this point, and we intend to devote this time to the remaining bugs that were designated as release blockers.
Target Milestone: Bugzilla 2.16 → Bugzilla 2.18
Assignee | ||
Comment 8•23 years ago
|
||
Bringing back down to 2.16... this makes ssdbot's output really ugly for bugs with special characters in them. The fix is easy, low risk and really needs to be done before we can use Bug.pm in anything else (and I think it'd be useful for the show_bug.cgi templatization).
Target Milestone: Bugzilla 2.18 → Bugzilla 2.16
Comment 9•23 years ago
|
||
Comment on attachment 57496 [details] [diff] [review] Bug.pm and importxml.pl r= justdave
Attachment #57496 -
Flags: review+
Comment 10•23 years ago
|
||
One quick question about the patch: sub QuoteXMLChars { + $_[0] =~ s/&/&/g; $_[0] =~ s/</</g; $_[0] =~ s/>/>/g; $_[0] =~ s/'/'/g; $_[0] =~ s/"/"/g; - $_[0] =~ s/&/&/g; # $_[0] =~ s/([\x80-\xFF])/&XmlUtf8Encode(ord($1))/ge; return($_[0]); is there some reason for the re-ordering, since that is all this appears to be doing? Otherwise, it looks fine to me.
Comment 11•23 years ago
|
||
reordering explained in irc; patch applied/tested on my 2.14 testbed. Looks good. r= louie
Updated•23 years ago
|
Attachment #57496 -
Flags: review+
Assignee | ||
Comment 12•23 years ago
|
||
Checking in Bug.pm; /cvsroot/mozilla/webtools/bugzilla/Bug.pm,v <-- Bug.pm new revision: 1.9; previous revision: 1.8 done Checking in importxml.pl; /cvsroot/mozilla/webtools/bugzilla/importxml.pl,v <-- importxml.pl new revision: 1.20; previous revision: 1.19 done
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
QA Contact: matty_is_a_geek → default-qa
You need to log in
before you can comment on or make changes to this bug.
Description
•