[FIXED JENKINS-9009] Fixed a bug in handling ' and " in matrix build

label axis
This commit is contained in:
Kohsuke Kawaguchi committed 2011-04-01 22:48:58 -07:00
1 parent 2d3608c276
commit f46e44bbaf
5 files changed
+62 -2

No files matched your search

+24
View File
@@ -538,6 +538,30 @@ public class Functions {
return Util.xmlEscape(s);
}
public static String htmlAttributeEscape(String text) {
StringBuilder buf = new StringBuilder(text.length()+64);
for( int i=0; i<text.length(); i++ ) {
char ch = text.charAt(i);
if(ch=='<')
buf.append("&lt;");
else
if(ch=='>')
buf.append("&gt;");
else
if(ch=='&')
buf.append("&amp;");
else
if(ch=='"')
buf.append("&quot;");
else
if(ch=='\'')
buf.append("&#39;");
else
buf.append(ch);
}
return buf.toString();
}
public static void checkPermission(Permission permission) throws IOException, ServletException {
checkPermission(Hudson.getInstance(),permission);
}