PHP 4.0 Bug #5001: String parameter data of LDAP function calls is corrupted
| From: | johan dot troedsson at ei dot sigma dot se | Date: | Tue, 13 Jun 2000 12:12:43 +0000 |
| Subject: | PHP 4.0 Bug #5001: String parameter data of LDAP function calls is corrupted | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-21196@lists.php.net to get a copy of this message | ||
From: johan.troedsson@ei.sigma.se
Operating system: Linux Redhat 5.2
PHP version: 4.0 Release Candidate 2
PHP Bug Type: LDAP related
Bug description: String parameter data of LDAP function calls is corrupted
When I create the array and strings that goes into several LDAP calls, I typically type:
$dataA[$key] = utf8_encode($value);
$searchbase = utf8_encode($dn);
etc.
This worked fine in PHP3, but in PHP4 the data transmitted is (sometimes?) corrupt as it reaches the
LDAP Server. I circumvented the problem by using the trim() function on every string value (also in
the arrays), before passing them to the PHP LDAP functions.
E.g.
o=Company Sigma becomes o=Company Sigma??*9
st=Oresund becomes st=Oresund2??*09:3
The appended characters seems to be arbitrary binary values. When trying to retrieve one of the
nodes holding these values, an LDAP "Decoding error" is returned.
Config line:
./configure \
--with-apache=../apache_1.3.12 \
--with-pgsql \
--with-mhash \
--with-ldap \
--disable-short-tags \
--enable-track-vars \
--enable-memory-limit=yes