Quotes in properties are not properly escaped in XML report

2 views
Skip to first unread message

Tero Pikala

unread,
Sep 23, 2009, 9:59:52 AM9/23/09
to mxunit
When MXUnit creates XML report it includes properties and when those
values have quotes it doesn't escape them properly.

(I did notice some discussions about this in other thread but latest
SVN code didn't yet have fix)

Patch is below.


Tero Pikala


Index: framework/JUnitXMLTestResult.cfc
===================================================================
--- framework/JUnitXMLTestResult.cfc (revision 1223)
+++ framework/JUnitXMLTestResult.cfc (working copy)
@@ -83,7 +83,7 @@
var properties = '';
for(prop in collection){
if( isSimpleValue(collection[prop]) ){
- properties = properties & '<property name="#ucase(prop)#"
value="#replace(collection[prop],"&","&amp;","all")#" />';
+ properties = properties & '<property name="#ucase(prop)#"
value="#replaceList(collection[prop],'&,"','&amp;,&quot;')#" />';
}else{
properties = properties & '<property name="#ucase(prop)#"
value="Complex Data Type...Not Displaying" />';
}
Reply all
Reply to author
Forward
0 new messages