Submitted by: Ryan Bennitt Bugzilla: https://issues.apache.org/bugzilla/show_bug.cgi?id=57341master
| @@ -330,6 +330,7 @@ Roger Vaughn | |||||
| Roman Ivashin | Roman Ivashin | ||||
| Ronen Mashal | Ronen Mashal | ||||
| Russell Gold | Russell Gold | ||||
| Ryan Bennitt | |||||
| Sam Ruby | Sam Ruby | ||||
| Sandra Metz | Sandra Metz | ||||
| Scott Carlson | Scott Carlson | ||||
| @@ -55,6 +55,11 @@ Fixed bugs: | |||||
| * complete-ant-cmd.pl now also knows about the -file option. | * complete-ant-cmd.pl now also knows about the -file option. | ||||
| Bugzilla Report 57371 | Bugzilla Report 57371 | ||||
| * the br-replace template inside the XSLT stylesheets used by | |||||
| <junitreport> could cause stack overflows or out-of-memory errors | |||||
| when applied to big outputs. | |||||
| Bugzilla Report 57341 | |||||
| Other changes: | Other changes: | ||||
| -------------- | -------------- | ||||
| @@ -1333,6 +1333,10 @@ | |||||
| <first>Russell</first> | <first>Russell</first> | ||||
| <last>Gold</last> | <last>Gold</last> | ||||
| </name> | </name> | ||||
| <name> | |||||
| <first>Ryan</first> | |||||
| <last>Bennitt</last> | |||||
| </name> | |||||
| <name> | <name> | ||||
| <first>Sam</first> | <first>Sam</first> | ||||
| <last>Ruby</last> | <last>Ruby</last> | ||||
| @@ -929,7 +929,24 @@ h6 { | |||||
| --> | --> | ||||
| <xsl:template name="br-replace"> | <xsl:template name="br-replace"> | ||||
| <xsl:param name="word"/> | <xsl:param name="word"/> | ||||
| <xsl:param name="splitlimit">32</xsl:param> | |||||
| <xsl:variable name="secondhalflen" select="(string-length($word)+(string-length($word) mod 2)) div 2"/> | |||||
| <xsl:variable name="secondhalfword" select="substring($word, $secondhalflen)"/> | |||||
| <!-- When word is very big, a recursive replace is very heap/stack expensive, so subdivide on line break after middle of string --> | |||||
| <xsl:choose> | <xsl:choose> | ||||
| <xsl:when test="(string-length($word) > $splitlimit) and (contains($secondhalfword, '
'))"> | |||||
| <xsl:variable name="secondhalfend" select="substring-after($secondhalfword, '
')"/> | |||||
| <xsl:variable name="firsthalflen" select="string-length($word) - $secondhalflen"/> | |||||
| <xsl:variable name="firsthalfword" select="substring($word, 1, $firsthalflen)"/> | |||||
| <xsl:variable name="firsthalfend" select="substring-before($secondhalfword, '
')"/> | |||||
| <xsl:call-template name="br-replace"> | |||||
| <xsl:with-param name="word" select="concat($firsthalfword,$firsthalfend)"/> | |||||
| </xsl:call-template> | |||||
| <br/> | |||||
| <xsl:call-template name="br-replace"> | |||||
| <xsl:with-param name="word" select="$secondhalfend"/> | |||||
| </xsl:call-template> | |||||
| </xsl:when> | |||||
| <xsl:when test="contains($word, '
')"> | <xsl:when test="contains($word, '
')"> | ||||
| <xsl:value-of select="substring-before($word, '
')"/> | <xsl:value-of select="substring-before($word, '
')"/> | ||||
| <br/> | <br/> | ||||
| @@ -938,7 +955,7 @@ h6 { | |||||
| </xsl:call-template> | </xsl:call-template> | ||||
| </xsl:when> | </xsl:when> | ||||
| <xsl:otherwise> | <xsl:otherwise> | ||||
| <xsl:value-of select="$word"/> | |||||
| <xsl:value-of select="$word"/> | |||||
| </xsl:otherwise> | </xsl:otherwise> | ||||
| </xsl:choose> | </xsl:choose> | ||||
| </xsl:template> | </xsl:template> | ||||
| @@ -469,7 +469,24 @@ | |||||
| --> | --> | ||||
| <xsl:template name="br-replace"> | <xsl:template name="br-replace"> | ||||
| <xsl:param name="word"/> | <xsl:param name="word"/> | ||||
| <xsl:param name="splitlimit">32</xsl:param> | |||||
| <xsl:variable name="secondhalflen" select="(string-length($word)+(string-length($word) mod 2)) div 2"/> | |||||
| <xsl:variable name="secondhalfword" select="substring($word, $secondhalflen)"/> | |||||
| <!-- When word is very big, a recursive replace is very heap/stack expensive, so subdivide on line break after middle of string --> | |||||
| <xsl:choose> | <xsl:choose> | ||||
| <xsl:when test="(string-length($word) > $splitlimit) and (contains($secondhalfword, '
'))"> | |||||
| <xsl:variable name="secondhalfend" select="substring-after($secondhalfword, '
')"/> | |||||
| <xsl:variable name="firsthalflen" select="string-length($word) - $secondhalflen"/> | |||||
| <xsl:variable name="firsthalfword" select="substring($word, 1, $firsthalflen)"/> | |||||
| <xsl:variable name="firsthalfend" select="substring-before($secondhalfword, '
')"/> | |||||
| <xsl:call-template name="br-replace"> | |||||
| <xsl:with-param name="word" select="concat($firsthalfword,$firsthalfend)"/> | |||||
| </xsl:call-template> | |||||
| <br/> | |||||
| <xsl:call-template name="br-replace"> | |||||
| <xsl:with-param name="word" select="$secondhalfend"/> | |||||
| </xsl:call-template> | |||||
| </xsl:when> | |||||
| <xsl:when test="contains($word, '
')"> | <xsl:when test="contains($word, '
')"> | ||||
| <xsl:value-of select="substring-before($word, '
')"/> | <xsl:value-of select="substring-before($word, '
')"/> | ||||
| <br/> | <br/> | ||||
| @@ -478,7 +495,7 @@ | |||||
| </xsl:call-template> | </xsl:call-template> | ||||
| </xsl:when> | </xsl:when> | ||||
| <xsl:otherwise> | <xsl:otherwise> | ||||
| <xsl:value-of select="$word"/> | |||||
| <xsl:value-of select="$word"/> | |||||
| </xsl:otherwise> | </xsl:otherwise> | ||||
| </xsl:choose> | </xsl:choose> | ||||
| </xsl:template> | </xsl:template> | ||||