Repository: wicket Updated Branches: refs/heads/wicket-7.x 48239c974 -> 3e745e7b6
WICKET-6085 eval in global scope, to prevent leak of local variables into the evaluated script Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/3e745e7b Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/3e745e7b Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/3e745e7b Branch: refs/heads/wicket-7.x Commit: 3e745e7b6ca98fc2ce5dc77137b36c5144525e0c Parents: 48239c9 Author: Sven Meier <[email protected]> Authored: Sat Feb 6 00:18:15 2016 +0100 Committer: Sven Meier <[email protected]> Committed: Sat Feb 6 00:19:42 2016 +0100 ---------------------------------------------------------------------- .../org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/3e745e7b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js index 9db558a..0f8a67f 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js @@ -1186,8 +1186,8 @@ var toExecute = "f = function(" + parameters + ") {" + body + "};"; try { - // do the evaluation - eval(toExecute); + // do the evaluation in global scope + window.eval(toExecute); f(notify); } catch (exception) { log.error("Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript: " + exception + ", text: " + text); @@ -1200,8 +1200,8 @@ return function(notify) { // just evaluate the javascript try { - // do the evaluation - eval(script); + // do the evaluation in global scope + window.eval(script); } catch (exception) { log.error("Wicket.Ajax.Call.processEvaluation: Exception evaluating javascript: " + exception + ", text: " + text); } @@ -2265,7 +2265,8 @@ Wicket.Head.addJavascript(text, id, "", type); } else { try { - eval(text); + // do the evaluation in global scope + window.eval(text); } catch (e) { Wicket.Log.error("Wicket.Head.Contributor.processScript: " + e + ": eval -> " + text); }
