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 2012/07/05 10:36:29 UTC

[2/2] git commit: Add a note that JavaScriptUtils#escapeQuotes() cannot be used for escaping JSON values.

Add a note that JavaScriptUtils#escapeQuotes() cannot be used for escaping JSON values.


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

Branch: refs/heads/master
Commit: 8c350d00d56491a29bfae04b9842fa5494d0f778
Parents: 74c0e98
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Thu Jul 5 10:19:29 2012 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Thu Jul 5 10:19:29 2012 +0200

----------------------------------------------------------------------
 .../wicket/core/util/string/JavaScriptUtils.java   |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/8c350d00/wicket-core/src/main/java/org/apache/wicket/core/util/string/JavaScriptUtils.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/string/JavaScriptUtils.java b/wicket-core/src/main/java/org/apache/wicket/core/util/string/JavaScriptUtils.java
index ed0022e..f07d515 100644
--- a/wicket-core/src/main/java/org/apache/wicket/core/util/string/JavaScriptUtils.java
+++ b/wicket-core/src/main/java/org/apache/wicket/core/util/string/JavaScriptUtils.java
@@ -78,8 +78,10 @@ public class JavaScriptUtils
 	/**
 	 * Escape single and double quotes so that they can be part of e.g. an alert call.
 	 *
+	 * Note: JSON values need to escape only the double quote, so this method wont help.
+	 *
 	 * @param input
-	 *            input
+	 *            the JavaScript which needs to be escaped
 	 * @return Escaped version of the input
 	 */
 	public static CharSequence escapeQuotes(final CharSequence input)