renamed ldap::ldapAddslashes to ldap::quote, like in db::quote or preg_quote

This commit is contained in:
Ralf Becker 2006-06-13 04:22:24 +00:00
parent b2a0081696
commit 2c87623e9b
2 changed files with 4 additions and 3 deletions

View File

@ -273,7 +273,7 @@
{
$GLOBALS['egw']->ldap =& CreateObject('phpgwapi.ldap');
}
return $GLOBALS['egw']->ldap->ldap_addslashes($string);
return ldap::quote($string);
}
/**

View File

@ -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);
}