summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--program/include/rcube_ldap.inc5
1 files changed, 4 insertions, 1 deletions
diff --git a/program/include/rcube_ldap.inc b/program/include/rcube_ldap.inc
index 608365269..29e7faa6b 100644
--- a/program/include/rcube_ldap.inc
+++ b/program/include/rcube_ldap.inc
@@ -285,9 +285,12 @@ class rcube_ldap
}
$filter .= ')';
+ // avoid double-wildcard if $value is empty
+ $filter = preg_replace('/\*+/', '*', $filter);
+
// add general filter to query
if (!empty($this->prop['filter']))
- $filter = '(&('.$this->prop['filter'] .')' . $filter . ')';
+ $filter = '(&(' . preg_replace('/^\(|\)$/', '', $this->prop['filter']) . ')' . $filter . ')';
// set filter string and execute search
$this->set_search_set($filter);