1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 11:12:22 -05:00

Caldav: encode LF to %0A in urlcompname

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1733 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2011-07-14 21:35:17 +00:00
parent 5e873cf756
commit 876deaf969

View File

@ -133,6 +133,7 @@ public final class StringUtil {
private static final Pattern GT_PATTERN = Pattern.compile(">"); private static final Pattern GT_PATTERN = Pattern.compile(">");
private static final Pattern QUOTE_PATTERN = Pattern.compile("\""); private static final Pattern QUOTE_PATTERN = Pattern.compile("\"");
private static final Pattern LF_PATTERN = Pattern.compile("\n");
private static final Pattern URLENCODED_AMP_PATTERN = Pattern.compile("%26"); private static final Pattern URLENCODED_AMP_PATTERN = Pattern.compile("%26");
@ -294,6 +295,9 @@ public final class StringUtil {
if (result.indexOf('"') >= 0) { if (result.indexOf('"') >= 0) {
result = QUOTE_PATTERN.matcher(result).replaceAll("%22"); result = QUOTE_PATTERN.matcher(result).replaceAll("%22");
} }
if (result.indexOf('\n') >= 0) {
result = LF_PATTERN.matcher(result).replaceAll("%0A");
}
return result; return result;
} }