Author: bodewig
Date: Tue Jul 21 05:00:59 2009
New Revision: 796144
URL: http://svn.apache.org/viewvc?rev=796144&view=rev
Log:
keep escaping XML in stacktraces. PR 39492
Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/src/etc/junit-frames.xsl
ant/core/trunk/src/etc/junit-noframes.xsl
Modified: ant/core/trunk/WHATSNEW
URL:
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=796144&r1=796143&r2=796144&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Tue Jul 21 05:00:59 2009
@@ -408,6 +408,10 @@
update attribute has been set to true.
Bugzilla Report 30751.
+ * The default stylesheets for <junitreport> failed to properly escape
+ XML content in exception stack traces.
+ Bugzilla Report 39492
+
Other changes:
--------------
* The get task now also follows redirects from http to https
Modified: ant/core/trunk/src/etc/junit-frames.xsl
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/etc/junit-frames.xsl?rev=796144&r1=796143&r2=796144&view=diff
==============================================================================
--- ant/core/trunk/src/etc/junit-frames.xsl (original)
+++ ant/core/trunk/src/etc/junit-frames.xsl Tue Jul 21 05:00:59 2009
@@ -862,7 +862,18 @@
-->
<xsl:template name="br-replace">
<xsl:param name="word"/>
- <xsl:value-of disable-output-escaping="yes"
select='stringutils:replace(string($word),"
","<br/>")'/>
+ <xsl:choose>
+ <xsl:when test="contains($word, '
')">
+ <xsl:value-of select="substring-before($word, '
')"/>
+ <br/>
+ <xsl:call-template name="br-replace">
+ <xsl:with-param name="word" select="substring-after($word,
'
')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$word"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<xsl:template name="display-time">
Modified: ant/core/trunk/src/etc/junit-noframes.xsl
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/etc/junit-noframes.xsl?rev=796144&r1=796143&r2=796144&view=diff
==============================================================================
--- ant/core/trunk/src/etc/junit-noframes.xsl (original)
+++ ant/core/trunk/src/etc/junit-noframes.xsl Tue Jul 21 05:00:59 2009
@@ -451,7 +451,18 @@
-->
<xsl:template name="br-replace">
<xsl:param name="word"/>
- <xsl:value-of disable-output-escaping="yes"
select='stringutils:replace(string($word),"
","<br/>")'/>
+ <xsl:choose>
+ <xsl:when test="contains($word, '
')">
+ <xsl:value-of select="substring-before($word, '
')"/>
+ <br/>
+ <xsl:call-template name="br-replace">
+ <xsl:with-param name="word" select="substring-after($word,
'
')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$word"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<xsl:template name="display-time">