From 2c87623e9bf3f30f0e43a512c81fe815699dfa48 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 13 Jun 2006 04:22:24 +0000 Subject: [PATCH] renamed ldap::ldapAddslashes to ldap::quote, like in db::quote or preg_quote --- phpgwapi/inc/class.common.inc.php | 2 +- phpgwapi/inc/class.ldap.inc.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) 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); }