fix ldap driver when p=0 and n=0
authorChristian Weiske <cweiske@cweiske.de>
Thu, 13 Feb 2014 19:55:19 +0000 (20:55 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Thu, 13 Feb 2014 19:55:19 +0000 (20:55 +0100)
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);
             }
 
                 $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(
             $options = array(
                 'scope'      => 'sub',
                 'attributes' => array(