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

LDAP: fix regression on OSX directory request on iCal start: filter invalid imapUid condition

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1307 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-07-27 21:11:23 +00:00
parent 2bfb33807a
commit 9e779b2826

View File

@ -1091,11 +1091,19 @@ public class LdapConnection extends AbstractConnection {
ExchangeSession.Condition condition = null;
if (operator == LDAP_FILTER_EQUALITY) {
condition = session.isEqualTo(contactAttributeName, value);
try {
// check imapUid value
if ("imapUid".equals(contactAttributeName)) {
Integer.parseInt(value);
}
condition = session.isEqualTo(contactAttributeName, value);
} catch (NumberFormatException e) {
// ignore condition
}
} else if ("*".equals(value)) {
condition = session.not(session.isNull(contactAttributeName));
// do not allow substring search on integer field imapUid
} else if (!"imapUid".equals(contactAttributeName)){
// do not allow substring search on integer field imapUid
} else if (!"imapUid".equals(contactAttributeName)) {
// endsWith not supported by exchange, convert to contains
if (mode == LDAP_SUBSTRING_FINAL || mode == LDAP_SUBSTRING_ANY) {
condition = session.contains(contactAttributeName, value);
@ -1387,7 +1395,7 @@ public class LdapConnection extends AbstractConnection {
*
* @param condition search filter
* @param returningAttributes requested attributes
* @param maxCount maximum item count
* @param maxCount maximum item count
* @return List of users
* @throws IOException on error
*/