1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-08-13 16:53:51 -04:00

Caldav: fix encode pipe | to %7C in urlcompname

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1946 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2012-04-17 20:59:02 +00:00
parent 8dd4e42904
commit 2ae4ed602e
2 changed files with 6 additions and 1 deletions

View File

@ -164,7 +164,7 @@ public final class StringUtil {
private static final Pattern SLASH_PATTERN = Pattern.compile("/"); private static final Pattern SLASH_PATTERN = Pattern.compile("/");
private static final Pattern UNDERSCORE_PATTERN = Pattern.compile("_"); private static final Pattern UNDERSCORE_PATTERN = Pattern.compile("_");
private static final Pattern DASH_PATTERN = Pattern.compile("-"); private static final Pattern DASH_PATTERN = Pattern.compile("-");
private static final Pattern PIPE_PATTERN = Pattern.compile("|"); private static final Pattern PIPE_PATTERN = Pattern.compile("\\|");
// WebDav search parameter encode // WebDav search parameter encode
private static final Pattern APOS_PATTERN = Pattern.compile("'"); private static final Pattern APOS_PATTERN = Pattern.compile("'");

View File

@ -102,4 +102,9 @@ public class StringUtilTest extends TestCase {
assertEquals("test", StringUtil.removeQuotes("test")); assertEquals("test", StringUtil.removeQuotes("test"));
assertEquals("test", StringUtil.removeQuotes("\"test\"")); assertEquals("test", StringUtil.removeQuotes("\"test\""));
} }
public void testEncodePipe() {
assertEquals("test %7C", StringUtil.encodeUrlcompname("test |"));
assertEquals("test |", StringUtil.decodeUrlcompname("test %7C"));
}
} }