提交 1c3d9b05 编写于 作者: K Kohsuke Kawaguchi

fixed excessive escaping

上级 8f62f7e4
......@@ -539,6 +539,10 @@ public class Functions {
return Util.xmlEscape(s);
}
public static String xmlUnescape(String s) {
return s.replace("&lt;","<").replace("&gt;",">").replace("&amp;","&");
}
public static String htmlAttributeEscape(String text) {
StringBuilder buf = new StringBuilder(text.length()+64);
for( int i=0; i<text.length(); i++ ) {
......
......@@ -63,29 +63,29 @@ THE SOFTWARE.
<t:editableDescription permission="${it.owner.UPDATE}"/>
<table style="margin-top: 1em; margin-left:0em;">
<j:forEach var="action" items="${it.testActions}">
<st:include page="summary.jelly" from="${action}" optional="true" it="${action}" />
</j:forEach>
<j:forEach var="action" items="${it.testActions}">
<st:include page="summary.jelly" from="${action}" optional="true" it="${action}" />
</j:forEach>
</table>
<j:if test="${!empty(it.errorDetails)}">
<h3>${%Error Message}</h3>
<pre>${it.annotate(it.errorDetails)}</pre>
<h3>${%Error Message}</h3>
<pre><j:out value="${it.annotate(it.errorDetails)}"/></pre>
</j:if>
<j:if test="${!empty(it.errorStackTrace)}">
<h3>${%Stacktrace}</h3>
<pre>${it.annotate(it.errorStackTrace)}</pre>
<h3>${%Stacktrace}</h3>
<pre><j:out value="${it.annotate(it.errorStackTrace)}"/></pre>
</j:if>
<j:if test="${!empty(it.stdout)}">
<h3>${%Standard Output}</h3>
<pre>${it.annotate(it.stdout)}</pre>
<pre><j:out value="${it.annotate(it.stdout)}"/></pre>
</j:if>
<j:if test="${!empty(it.stderr)}">
<h3>${%Standard Error}</h3>
<pre>${it.annotate(it.stderr)}</pre>
<pre><j:out value="${it.annotate(it.stderr)}"/></pre>
</j:if>
</l:main-panel>
</l:layout>
......
......@@ -38,6 +38,6 @@ THE SOFTWARE.
</st:documentation>
<!-- No escape/encode to avoid double-encoding if used in value attribute below -->
<j:set var="optionBody" encode="false"><d:invokeBody escapeText="false"/></j:set>
<option value="${attrs.value!=null?attrs.value:optionBody}"
selected="${attrs.selected?'true':null}">${optionBody}</option>
<option value="${attrs.value!=null?attrs.value:h.xmlUnescape(optionBody)}"
selected="${attrs.selected?'true':null}"><j:out value="${optionBody}"/></option>
</j:jelly>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册