1
0
mirror of https://github.com/moparisthebest/davmail synced 2025-01-12 22:18:11 -05:00

EWS: Fix 3165749, exception with quotes in meeting subject and EWS

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1617 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2011-02-02 22:59:37 +00:00
parent 3380b1c262
commit 1ffd5bc279

View File

@ -132,6 +132,8 @@ public final class StringUtil {
private static final Pattern LT_PATTERN = Pattern.compile("<");
private static final Pattern GT_PATTERN = Pattern.compile(">");
private static final Pattern QUOTE_PATTERN = Pattern.compile("\"");
private static final Pattern URLENCODED_AMP_PATTERN = Pattern.compile("%26");
private static final Pattern ENCODED_AMP_PATTERN = Pattern.compile("&amp;");
@ -194,6 +196,9 @@ public final class StringUtil {
if (name.indexOf('>') >= 0) {
result = GT_PATTERN.matcher(result).replaceAll("&gt;");
}
if (name.indexOf('"') >= 0) {
result = QUOTE_PATTERN.matcher(result).replaceAll("&#x22;");
}
}
return result;
}
@ -273,6 +278,9 @@ public final class StringUtil {
if (result.indexOf('>') >= 0) {
result = GT_PATTERN.matcher(result).replaceAll("%3E");
}
if (result.indexOf('"') >= 0) {
result = QUOTE_PATTERN.matcher(result).replaceAll("%22");
}
return result;
}