You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2013/04/26 14:22:32 UTC

git commit: WICKET-5159 Replace usage of JavaScript eval() with plain JS in headed contribution decoding

Updated Branches:
  refs/heads/master 8df9d9920 -> a3b31f263


WICKET-5159 Replace usage of JavaScript eval() with plain JS in headed contribution decoding

Replace eval() with a RegExp object.


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/a3b31f26
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/a3b31f26
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/a3b31f26

Branch: refs/heads/master
Commit: a3b31f2637e80f0e0795aa70b3f21573525394e8
Parents: 8df9d99
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Fri Apr 26 14:22:04 2013 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Fri Apr 26 14:22:04 2013 +0200

----------------------------------------------------------------------
 .../wicket/ajax/res/js/wicket-ajax-jquery.js       |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/a3b31f26/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 4ebf4ed..8a661ff 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
@@ -56,8 +56,7 @@
 	};
 
 	replaceAll = function (str, from, to) {
-		var regex = '';
-		eval('regex = /' + from.replace( /\W/g ,'\\$&' ) + '/g ;');
+		var regex = new RegExp(from.replace( /\W/g ,'\\$&' ), 'g');
 		return str.replace(regex,to);
 	};