PHP 4.0 Bug #8176: ldap_search munges binary data
| From: | binkleym at nukote dot com | Date: | Fri, 08 Dec 2000 19:59:23 +0000 |
| Subject: | PHP 4.0 Bug #8176: ldap_search munges binary data | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-40592@lists.php.net to get a copy of this message | ||
From: binkleym@nukote.com
Operating system: Debian Woody (with latest updates)
PHP version: 4.0.3pl1
PHP Bug Type: LDAP related
Bug description: ldap_search munges binary data
I have a clean installation of Debian Woody with PHP4, OpenLDAP 2, and the latest stable
apt-get's. I am trying to fetch a jpeg picture from the LDAP server with PHP, but I'm
only getting 3-4 characters. This looks similar to a previous LDAP bug (#5759)
I've run the script using PHP 4.0.3.pl1-7 and PHP 4.0.4-0RC3.2, and OpenLDAP 2.0.7-1.
Here's a sample script which generates the bug:
<?
Header( "Content-type: image/jpeg");
$ldap = ldap_connect("data2.nukote.com", "389");
$result = ldap_search($ldap, "o=nukote.com", "uid=binkleym");
if ($result) {
$temp = ldap_get_entries($ldap, $result);
if ($temp["count"] == 1) $entry = $temp[0];
}
ldap_close($ldap);
echo $entry["jpegphoto"][0];
?>
--
Edit Bug report at: http://bugs.php.net/?id=8176&edit=1