diff --git a/phpgwapi/inc/class.common.inc.php b/phpgwapi/inc/class.common.inc.php index 2000694d6e..e5ae17527f 100644 --- a/phpgwapi/inc/class.common.inc.php +++ b/phpgwapi/inc/class.common.inc.php @@ -273,7 +273,7 @@ { $GLOBALS['egw']->ldap =& CreateObject('phpgwapi.ldap'); } - return $GLOBALS['egw']->ldap->ldap_addslashes($string); + return ldap::quote($string); } /** diff --git a/phpgwapi/inc/class.ldap.inc.php b/phpgwapi/inc/class.ldap.inc.php index babfe92b43..dab357f2db 100644 --- a/phpgwapi/inc/class.ldap.inc.php +++ b/phpgwapi/inc/class.ldap.inc.php @@ -69,9 +69,10 @@ * Escaped Characters are: '*', '(', ')', ' ', '\', NUL * It's actually a PHP-Bug, that we have to escape space. * For all other Characters, refer to RFC2254. - * @param $string either a string to be escaped, or an array of values to be escaped + * + * @param string/array $string either a string to be escaped, or an array of values to be escaped */ - function ldapAddslashes($string='') + function quote($string) { return str_replace(array('\\','*','(',')','\0',' '),array('\\\\','\*','\(','\)','\\0','\20'),$string); }