Ticket #21 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

XML SAX doesn't escape attributes (patch included)

Reported by: CyberShadow Assigned to:
Priority: major Milestone:
Component: mango.xml.dom Version: SVN HEAD
Keywords: Cc: thecybershadow@gmail.com

Description

TeqXMLWriter.addAttribute doesn't escape the attribute value - thus attributes with a double-quote symbol (") would corrupt the XML output.

Attachments

my.diff (1.0 kB) - added by CyberShadow on 04/19/07 03:57:48.
proposed patch (v2)

Change History

04/19/07 01:49:57 changed by CyberShadow

  • owner changed.
  • version set to SVN HEAD.
  • component changed from Other to mango.xml.dom.

04/19/07 03:57:48 changed by CyberShadow

  • attachment my.diff added.

proposed patch (v2)

04/19/07 03:58:47 changed by CyberShadow

  • cc set to thecybershadow@gmail.com.

Attributes need to be unescaped when reading too - added code to decode entities when reading attributes.

04/21/07 00:45:51 changed by teqdruid

  • status changed from new to closed.
  • resolution set to fixed.

Thanks for the heads up and double thanks for the patch... I love patches!

I reworked the way you did unescaping to go forward and use only Text.locate- it's usually faster than a foreach search... Was there a particular reason you did it going in reverse instead of forward?

Thanks again! It's nice to know somebody is using and reading my code.

04/21/07 00:48:50 changed by CyberShadow

You're welcome for the patch :)

In this particular situation, I guess there was no reason to use a foreach_reverse, because foreach aggregates must be immutable. If they weren't, I could operate on the same array - and going from end to start would make sure I process each symbol only once. So, I did it out of habit :)