Ticket #1484823 (closed Bugs: fixed)
LDAP patch to remove double wildcards
| Reported by: | till | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.1-stable |
| Component: | PHP backend | Version: | svn-trunk |
| Severity: | normal | Keywords: | ldap |
| Cc: |
Description
--- program/include/rcube_ldap.inc (revision 1141)
+++ program/include/rcube_ldap.inc (working copy)
@@ -284,10 +284,16 @@
$filter .= "($f=$wc" . rcube_ldap::quote_string($value) . "$wc)";
}
$filter .= ')';
+
+ // avoid double-wildcard if $values is empty
+ $filter = preg_replace('/\*+/', '*', $filter);
// add general filter to query
- if (!empty($this->prop['filter']))
+ if (!empty($this->prop['filter'])) {
+ // remove trailing brackets
+ $this->prop['filter'] = preg_replace('/^\(|\)$/', '', $this->prop['filter']);
$filter = '(&('.$this->prop['filter'] .')' . $filter . ')';
+ }
// set filter string and execute search
$this->set_search_set($filter);
Patch by Roy McMorran?, revised by Emanuele Rocca,
Change History
Note: See
TracTickets for help on using
tickets.
