summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2015-02-20 09:45:24 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2015-02-20 09:45:24 (GMT)
commit7e6148385886be88e891e192d7d1703960a9785e (patch)
tree632a114ada077f437a9e5ba343ec1c7f9a1eab6f
parenta5953c2afb3c26f93dfa6bd5237bc1cfa679397d (diff)
downloadNet_LDAP3-7e6148385886be88e891e192d7d1703960a9785e.tar.gz
Make sure ldap filter is not empty when searching, use (objectclass=*) by default
ldap_search() throws errors on empty filter as find out in http://trac.roundcube.net/ticket/1490269. As this was a configuration issue we can simply prevent that and provide real and working default.
-rw-r--r--lib/Net/LDAP3.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Net/LDAP3.php b/lib/Net/LDAP3.php
index a825c3a..02b77ef 100644
--- a/lib/Net/LDAP3.php
+++ b/lib/Net/LDAP3.php
@@ -1552,12 +1552,16 @@ class Net_LDAP3
return false;
}
- $this->_debug("C: Search base dn: [$base_dn] scope [$scope] with filter [$filter]");
-
// make sure attributes list is not empty
if (empty($attrs)) {
$attrs = array('dn');
}
+ // make sure filter is not empty
+ if (empty($filter)) {
+ $filter = '(objectclass=*)';
+ }
+
+ $this->_debug("C: Search base dn: [$base_dn] scope [$scope] with filter [$filter]");
$function = self::scope_to_function($scope, $ns_function);