mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-20 07:22:32 +00:00
[FIXED JENKINS-9009] Fixed a bug in handling ' and " in matrix build
label axis
This commit is contained in:
1 parent
2d3608c276
commit
f46e44bbaf
5 files changed
+62
-2
No files matched your search
@@ -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("<");
|
||||
else
|
||||
if(ch=='>')
|
||||
buf.append(">");
|
||||
else
|
||||
if(ch=='&')
|
||||
buf.append("&");
|
||||
else
|
||||
if(ch=='"')
|
||||
buf.append(""");
|
||||
else
|
||||
if(ch=='\'')
|
||||
buf.append("'");
|
||||
else
|
||||
buf.append(ch);
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
public static void checkPermission(Permission permission) throws IOException, ServletException {
|
||||
checkPermission(Hudson.getInstance(),permission);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user