Skip to content

Commit

Permalink
Revert part of "Remove dead JS code (jenkinsci#9136)"
Browse files Browse the repository at this point in the history
https://issues.jenkins.io/browse/JENKINS-73166 notes that the credentials
code for certificates has a dependency on this JavaScript code.
Without this JavaScript, an attempt to add a new certificate credential
type using PKCS#12 will fail with an HTTP 404 error.

The replacement of YUI.log with console.log is not involved in the bug
report, so it is retained in the code change.

This reverts part of commit 932ab19c5448bb0afa46f60b93c245eb08e86b55.
  • Loading branch information
MarkEWaite committed May 17, 2024
1 parent 2457278 commit 38fdae4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions war/src/main/webapp/scripts/hudson-behavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,10 +589,15 @@ function parseHtml(html) {

/**
* Evaluates the script in global context.
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#direct_and_indirect_eval
*/
function geval(script) {
eval(script);
// execScript chokes on "" but eval doesn't, so we need to reject it first.
if (script == null || script == "") {
return;
}
// see http://perfectionkills.com/global-eval-what-are-the-options/
// note that execScript cannot return value
(this.execScript || eval)(script);
}

/**
Expand Down

0 comments on commit 38fdae4

Please sign in to comment.