Re: PHP 4.0 Bug #8176: ldap_search munges binary data
| From: | Ignacio Vazquez-Abrams | Date: | Fri, 08 Dec 2000 20:15:41 +0000 |
| Subject: | Re: PHP 4.0 Bug #8176: ldap_search munges binary data | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-40596@lists.php.net to get a copy of this message | ||
On 8 Dec 2000 binkleym@nukote.com wrote:
> 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];
>
> ?>
>
Quick question: are you storing the image base64-encoded as per spec?
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>