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 <[email protected]>
Authored: Thu Jul 5 10:19:29 2012 +0200
Committer: Martin Tzvetanov Grigorov <[email protected]>
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)

Reply via email to