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:
parent
3380b1c262
commit
1ffd5bc279
@ -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("&");
|
||||
@ -194,6 +196,9 @@ public final class StringUtil {
|
||||
if (name.indexOf('>') >= 0) {
|
||||
result = GT_PATTERN.matcher(result).replaceAll(">");
|
||||
}
|
||||
if (name.indexOf('"') >= 0) {
|
||||
result = QUOTE_PATTERN.matcher(result).replaceAll(""");
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user