Permalink
Browse files

XmlReport should escape text for valid xml

  • Loading branch information...
1 parent 037c094 commit 27ab9c2ed61d405d11187d99be5cd2765d853b72 Ron Hopper committed Nov 6, 2009
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/XmlReport.cfc
View
6 lib/XmlReport.cfc
@@ -68,11 +68,11 @@
<cfargument name="status">
<cfargument name="expectation">
<cfargument name="exception" default="#structNew()#">
- <cfset var s = '<testcase classname="#_specFile#" name="#arrayToList(_block, ' ')#: it #expectation##iif(status eq "pend", de(" (PENDING)"), de(""))#" time="#this.getTimer()#"'>
+ <cfset var s = '<testcase classname="#_specFile#" name="#arrayToList(_block, ' ')#: it #xmlFormat(expectation)##iif(status eq "pend", de(" (PENDING)"), de(""))#" time="#this.getTimer()#"'>
<cfparam name="exception.message" default="">
<cfif status eq "fail">
<cfset _failureCount = _failureCount + 1>
- <cfset s = s & '><failure>' & exception.message & '</failure></testcase>'>
+ <cfset s = s & '><failure>' & xmlFormat(exception.message) & '</failure></testcase>'>
<cfelseif status eq "error">
<cfset _errorCount = _errorCount + 1>
<cfset s = s & '><error>' & formatException(exception) & '</error></testcase>'>
@@ -125,7 +125,7 @@
<cfset var context = "">
<cfset var s = "">
<cfset var i = "">
- <cfset s = "<u>#e.type#</u><br />Message: #e.message#<br />Detail: #e.detail#<br />Stack Trace:">
+ <cfset s = "<u>#e.type#</u><br />Message: #xmlFormat(e.message)#<br />Detail: #xmlFormat(e.detail)#<br />Stack Trace:">
<cfloop index="i" from="1" to="#arrayLen(e.tagContext)#">
<cfset context = e.tagContext[i]>
<cfset s = s & "<pre> ">

0 comments on commit 27ab9c2

Please sign in to comment.