Quellcode durchsuchen

ZF-9438
fixed problem with Zend_Ldap_Attribute::getDateTimeAttribute() having an inconsistent behavior when returning values that could not be converted to a timestamp

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@21531 44c647ce-9c0f-0410-b52a-842ac1e357ba

sgehrig vor 16 Jahren
Ursprung
Commit
bbcbd7864b
1 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen
  1. 5 2
      library/Zend/Ldap/Attribute.php

+ 5 - 2
library/Zend/Ldap/Attribute.php

@@ -382,10 +382,13 @@ class Zend_Ldap_Attribute
         if (is_array($values)) {
         if (is_array($values)) {
             for ($i = 0; $i<count($values); $i++) {
             for ($i = 0; $i<count($values); $i++) {
                 $newVal = self::_valueFromLdapDateTime($values[$i]);
                 $newVal = self::_valueFromLdapDateTime($values[$i]);
-                if (!is_null($newVal)) $values[$i] = $newVal;
+                if ($newVal !== null) $values[$i] = $newVal;
             }
             }
         }
         }
-        else $values = self::_valueFromLdapDateTime($values);
+        else {
+			$newVal = self::_valueFromLdapDateTime($values);
+			if ($newVal !== null) $values = $newVal;
+		}
         return $values;
         return $values;
     }
     }