Bug #12740 Updated: LDAP modify functions do not handle special characters
| From: | venaas@php.net | Date: | Mon, 12 Nov 2001 12:30:54 +0000 |
| Subject: | Bug #12740 Updated: LDAP modify functions do not handle special characters | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-70231@lists.php.net to get a copy of this message | ||
ID: 12740
Updated by: venaas
Reported By: christian@metamerge.com
Old Status: Feedback
Status: Closed
Bug Type: LDAP related
Operating System: Linux RH 7.1
PHP Version: 4.0.5
New Comment:
The problem turned out to be that the syntax for the
attribute was IA5, thus not allowing non-ASCII. We
should see if we can report more precise error messages
that includes which attribute was the problem.
Previous Comments:
------------------------------------------------------------------------
[2001-10-23 04:07:37] sniper@php.net
Okay, does the ldap server support ldap v3?
If so, you should propably try to add this:
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)
--Jani
------------------------------------------------------------------------
[2001-10-09 14:05:23] christian@metamerge.com
What would the locale setting change? According to the docs, PHP have a UTF8 internal reprsentation
of data...
------------------------------------------------------------------------
[2001-10-09 14:03:00] christian@metamerge.com
// Here is a function to translate all values of a multi-dimensional array to UTF8
function encoder ($array)
{
while ( list ($key, $val) = each ($array) )
{
if (!is_array($val))
$array[$key] = utf8_encode($val);
else $array[$key] = encoder ($val);
}
return $array;
}
//Here is a call where
// - $conn_id is a valid connection ID
// - $dn is the dn of the object to add
// - $array is the array containing the values of the attributes indexed by name
$array = encoder($arr);
ldap_add($conn_id, $dn, $array);
// this call fails
// - if $array contains a special char (e.g å, ø...) , thus returning SYNTAX ERROR
// - if $dn contains a special char (e.g å, ø...) , thus returning No Such Object
------------------------------------------------------------------------
[2001-10-02 18:39:49] sniper@php.net
I can't reprocude this with my test scripts. If this still
happens with PHP 4.0.6, reopen. Check also your locale settings.
------------------------------------------------------------------------
[2001-08-14 09:50:59] sniper@php.net
Please include a short example script in this report.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/?id=12740
Edit this bug report at http://bugs.php.net/?id=12740&edit=1