Menu

#17 CDATA close bracket ']]>' breaks xml encoder

open
nobody
None
5
2005-08-05
2005-08-05
Tim
No

The '>' is not being incoded correct so strings which
includes the CDATA closing bracket ']]>' break the xml
file being return from the browser....

The fix is easy, just encode the '>' character in
xml.js on line 29 as follows:

encodeString: function(v) {
- return '<s>'+v.replace(/&/g,
'&amp;').replace(/</g, '&lt;')+'</s>';
+ return '<s>'+v.replace(/&/g, '&amp;').replace(/</g,
'&lt;').replace(/>/g, '&gt;')+'</s>';
},

Discussion


Log in to post a comment.

MongoDB Logo MongoDB