You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by sv...@apache.org on 2015/06/27 09:42:33 UTC
wicket git commit: WICKET-5929 Strings.replaceAll() does the check
already; encode full ]]> sequence only
Repository: wicket
Updated Branches:
refs/heads/master 470f2a286 -> 2f7d43fcc
WICKET-5929 Strings.replaceAll() does the check already; encode full ]]> sequence only
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/2f7d43fc
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/2f7d43fc
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/2f7d43fc
Branch: refs/heads/master
Commit: 2f7d43fcc7726f33df8ffd1162dc8d697986e726
Parents: 470f2a2
Author: Sven Meier <sv...@apache.org>
Authored: Sat Jun 27 09:42:16 2015 +0200
Committer: Sven Meier <sv...@apache.org>
Committed: Sat Jun 27 09:42:16 2015 +0200
----------------------------------------------------------------------
.../org/apache/wicket/ajax/XmlPartialPageUpdate.java | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/2f7d43fc/wicket-core/src/main/java/org/apache/wicket/ajax/XmlPartialPageUpdate.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/XmlPartialPageUpdate.java b/wicket-core/src/main/java/org/apache/wicket/ajax/XmlPartialPageUpdate.java
index fb157c5..2fb6bd3 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/XmlPartialPageUpdate.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/XmlPartialPageUpdate.java
@@ -215,19 +215,7 @@ public class XmlPartialPageUpdate extends PartialPageUpdate
protected CharSequence encode(CharSequence str)
{
- /*
- * TODO Post 1.2: we can improve this by keeping a buffer of at least 3 characters and
- * checking that buffer so that we can narrow down escaping occurring only for ']]>'
- * sequence, or at least for ]] if ] is the last char in this buffer.
- *
- * but this improvement will only work if we write first and encode later instead of working
- * on fragments sent to write
- */
- if (Strings.indexOf(str, ']') >= 0) {
- str = Strings.replaceAll(str, "]]>", "]]]]><![CDATA[>").toString();
- }
-
- return str;
+ return Strings.replaceAll(str, "]]>", "]]]]><![CDATA[>");
}