LSldap : added entries objects check returning search result
authorBenjamin Renard <bn8@zionetrix.net>
Thu, 2 Aug 2012 13:26:02 +0000 (15:26 +0200)
committerBenjamin Renard <bn8@zionetrix.net>
Thu, 2 Aug 2012 13:26:02 +0000 (15:26 +0200)
public_html/includes/class/class.LSldap.php

index b66d817..994403a 100644 (file)
@@ -111,6 +111,10 @@ class LSldap {
     }
     $retInfos=array();
     foreach($ret -> entries() as $entry) {
+      if (!$entry instanceof Net_LDAP2_Entry) {
+        LSerror :: addErrorCode('LSldap_02',"LDAP search return an ".get_class($entry).". object");
+        continue;
+      }
       $retInfos[]=array('dn' => $entry -> dn(), 'attrs' => $entry -> getValues());
     }
     return $retInfos;