From f321f6de763b060ffecd3e7561d51a2577bc3a5c Mon Sep 17 00:00:00 2001 From: mguessan Date: Sun, 7 Aug 2011 12:53:40 +0000 Subject: [PATCH] Caldav: Need to encode % in urlcompname git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1765 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/util/StringUtil.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/java/davmail/util/StringUtil.java b/src/java/davmail/util/StringUtil.java index 9729571e..f5fec44e 100644 --- a/src/java/davmail/util/StringUtil.java +++ b/src/java/davmail/util/StringUtil.java @@ -131,6 +131,7 @@ public final class StringUtil { private static final Pattern AMP_PATTERN = Pattern.compile("&"); private static final Pattern LT_PATTERN = Pattern.compile("<"); private static final Pattern GT_PATTERN = Pattern.compile(">"); + private static final Pattern PERCENT_PATTERN = Pattern.compile("%"); private static final Pattern QUOTE_PATTERN = Pattern.compile("\""); private static final Pattern CR_PATTERN = Pattern.compile("\r"); @@ -307,6 +308,9 @@ public final class StringUtil { if (result.indexOf("_x000D__x000A_") >= 0) { result = X0D0A_PATTERN.matcher(result).replaceAll("\r\n"); } + if (result.indexOf('%') >= 0) { + result = PERCENT_PATTERN.matcher(result).replaceAll("%25"); + } return result; }