fix ldap driver when p=0 and n=0
[bdrem.git] / src / bdrem / Source / Ldap.php
index 802d709..335be07 100644 (file)
@@ -53,7 +53,11 @@ class Source_Ldap
                 $filters[] = \Net_LDAP2_Filter::create($dateAttribute, 'ends', $day);
             }
 
-            $filter  = \Net_LDAP2_Filter::combine('or', $filters);
+            if (count($filters) < 2) {
+                $filter = $filters[0];
+            } else {
+                $filter = \Net_LDAP2_Filter::combine('or', $filters);
+            }
             $options = array(
                 'scope'      => 'sub',
                 'attributes' => array(