Menu

#19 Bug in XML escaping of messages

open
nobody
None
5
2003-05-28
2003-05-28
Anonymous
No

There's a bug in XML1's XML_EscapeChars (actually it's
within HTML_EscapeChars) that causes XML not to be
escaped correctly.

Basically, if you want to send a message whose body is:

<text>This car belongs to Jim & Alice</text>

the body should be escaped so that it becomes:

<text>This car belongs to Jim &
Alice<text>

This way when it gets to the other side and is
unescaped, it again becomes:

<text>This car belongs to Jim & Alice</text>

What I'm actually seeing is:

<text>This car belongs to Jim & Alice</text>

which of course isn't right after unescaping it. Looking
at the code, I don't see why the '>' is not getting
escaped. The '&' should be simply escaped by
changing it to & but the HTML_EscapeChars code
is not doing that - it's way too complicated.

If anybody has a fix for this, you can send me email at
johnhanna@crd.com

Thanks,

John

Discussion


Log in to post a comment.