ZF-11639: Zend_Ldap casts all numeric fields to a float (including telephone numbers).

Issue Type: Bug Created: 2011-08-03T11:36:47.000+0000 Last Updated: 2011-08-05T07:38:39.000+0000 Status: Resolved Fix version(s): Reporter: John Saxon (sacko87) Assignee: Stefan Gehrig (sgehrig) Tags: - Zend_Ldap

  • Zend

Related issues: Attachments:


When using Zend_Ldap to access the telephoneNumber attribute, or in deed any similar attribute, by means of getAttribute(), it always casts the value to a float due to the value being numeric.

For example, if this was found within an LDAP entry: bq. +442012345678

The function: bq. $ldapNode->getAttribute("telephoneNumber", 0)

Would return: bq. 442012345678

The problem resides in: bq. Zend_Ldap_Converter::fromLdap() (line 221)


Posted by Stefan Gehrig (sgehrig) on 2011-08-04T20:25:27.000+0000

fixed in r24349

Posted by John Saxon (sacko87) on 2011-08-04T20:56:15.000+0000

Thanks for the fix. Although there will still be an issue when a user enters a phone number without the international calling code.

Is there even a need to cast it to a float with PHP's typing? Let the implementation decide how to treat it.

Posted by Stefan Gehrig (sgehrig) on 2011-08-05T07:38:39.000+0000

I removed the type-casting to float completely. Although this is a minor BC breakage, I don't think it'll affect anybody unless some user is relying on the type returned.

Code is updated with r24353 in trunk (r24354 in 1.11-release branch).

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.