Skip to content
Permalink
Browse files

[FIXED JENKINS-12202] fixed validation on exclude fields

we're now assuming that all ${} constructs are valid variables, and thus replacing them with a dummy value before attempting to validate
  • Loading branch information...
Rob Petti
Rob Petti committed Jan 27, 2012
1 parent 0607110 commit 106e85b309ab4d82c93656e980eb5302a70c15eb
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/main/java/hudson/plugins/perforce/PerforceSCM.java
@@ -1725,6 +1725,7 @@ public FormValidation doValidateExcludedUsers(StaplerRequest req) {
if(regex.equals("")) continue;

try {
regex = regex.replaceAll("\\$\\{[^\\}]*\\}","SOMEVARIABLE");
Pattern.compile(regex);
}
catch (PatternSyntaxException pse) {
@@ -1753,6 +1754,7 @@ public FormValidation doValidateExcludedFiles(StaplerRequest req) {
// check to make sure the globbing regex will work
// (ie, in case there are special characters that the user hasn't escaped properly)
try {
file = file.replaceAll("\\$\\{[^\\}]*\\}","SOMEVARIABLE");
doesFilenameMatchP4Pattern("somefile", file);
}
catch (PatternSyntaxException pse) {

0 comments on commit 106e85b

Please sign in to comment.
You can’t perform that action at this time.