ZF-7888: Can't add/update value '0' becouse it will by filtered in Zend_Ldap::prepareLdapEntryArray

Issue Type: Bug Created: 2009-09-18T08:27:01.000+0000 Last Updated: 2009-09-18T08:54:13.000+0000 Status: Resolved Fix version(s): - 1.9.3 (22/Sep/09)

Reporter: Rafael Krysciak (rafael.krysciak) Assignee: Stefan Gehrig (sgehrig) Tags: - Zend_Ldap

Related issues: Attachments:


i want to update an entry with the value '0' but the function prepareLdapEntryArray delete the entry. Example:

$myEntry = array( 'required_field' => array('0'), 'objectclass' => 'oclass', );

$ldap->update('ou=my,ou=path,o=ldap', $entry);

this make an exception:

Zend_Ldap_Exception: 0x41 (Object class violation; object class 'oclass' requires attribute 'required_field'): updating: ou=my,ou=path,o=ldap

The reason for theat ist in the funktion prepareLdapEntryArray in Zend/Ldap.php Line 1041

... else if (empty($v)) unset($value[$i]); ...

for the function empty is a string with '0' empty. Perhaps is this a good solution:

... else if ($v === '') unset($value[$i]); ...


Posted by Stefan Gehrig (sgehrig) on 2009-09-18T08:54:13.000+0000

Fixed in trunk r18249 and in 1.9-release branch (r18250).

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.