Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 committed Jan 27, 2012
1 parent 0607110 commit 106e85b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/hudson/plugins/perforce/PerforceSCM.java
Expand Up @@ -1725,6 +1725,7 @@ public FormValidation doValidateExcludedUsers(StaplerRequest req) {
if(regex.equals("")) continue;

try {
regex = regex.replaceAll("\\$\\{[^\\}]*\\}","SOMEVARIABLE");
Pattern.compile(regex);
}
catch (PatternSyntaxException pse) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 106e85b

Please sign in to comment.