Skip to content
Permalink
Browse files

Merge pull request #1 from redsolo/jenkins-10139

[JENKINS-10139] Fix for regex containing back slashes
  • Loading branch information
petehayes committed Sep 14, 2011
2 parents b787ed0 + 80a358f commit c48afbb1e5e9f64c80ac26d5d109033f82b02e89
@@ -73,6 +73,10 @@ public String getRegex() {
return regex;
}

public String getJsEncodedRegex() {
return regex.replace("\\", "\\\\");
}

public String getFailedValidationMessage() {
return failedValidationMessage;
}
@@ -29,7 +29,7 @@ THE SOFTWARE.
<div name="parameter" description="${it.description}">
<input type="hidden" name="name" value="${it.name}" />
<f:textbox name="value" value="${it.defaultValue}"
checkUrl="'${it.rootUrl}/descriptor/hudson.plugins.validating_string_parameter.ValidatingStringParameterDefinition/validate?regex='+encodeURIComponent(&quot;${it.regex}&quot;)+'&amp;failedValidationMessage='+encodeURIComponent(&quot;${it.failedValidationMessage}&quot;)+'&amp;value='+encodeURIComponent(this.value)"/>
checkUrl="'${it.rootUrl}/descriptor/hudson.plugins.validating_string_parameter.ValidatingStringParameterDefinition/validate?regex='+encodeURIComponent(&quot;${it.jsEncodedRegex}&quot;)+'&amp;failedValidationMessage='+encodeURIComponent(&quot;${it.failedValidationMessage}&quot;)+'&amp;value='+encodeURIComponent(this.value)"/>
</div>
</f:entry>
</j:jelly>

0 comments on commit c48afbb

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