Skip to content

Commit

Permalink
[JENKINS-19457] Wrap eval in try-catch to prevent job configuration b…
Browse files Browse the repository at this point in the history
…reakdown
  • Loading branch information
jabbrwcky committed Sep 3, 2013
1 parent 0e3c7a9 commit afa517e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion war/src/main/webapp/scripts/hudson-behavior.js
Expand Up @@ -413,7 +413,13 @@ function registerValidator(e) {
var depends = this.getAttribute("checkDependsOn");

if (depends==null) {// legacy behaviour where checkUrl is a JavaScript
return eval(url); // need access to 'this', so no 'geval'
try {
return eval(url); // need access to 'this', so no 'geval'
} catch (e) {
if (window.console!=null) console.warn("Legacy checkUrl '" + url + "' is not valid Javascript: "+e);
if (window.YUI!=null) YUI.log("Legacy checkUrl '" + url + "' is not valid Javascript: "+e,"warn");
return url; // return plain url as fallback
}
} else {
var q = qs(this).addThis();
if (depends.length>0)
Expand Down

0 comments on commit afa517e

Please sign in to comment.