mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 17:18:54 +01:00
added escape-function for ldap-queries - will be used by contacts soon
This commit is contained in:
parent
5cb848c8d6
commit
bc140271bc
@ -225,6 +225,19 @@
|
||||
return $retValue;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function ldap_addslashes
|
||||
@abstract escapes a string for use in searchfilters meant for ldap_search.
|
||||
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 string to be escaped
|
||||
*/
|
||||
function ldap_addslashes($string='')
|
||||
{
|
||||
return str_replace(array('\\','*','(',')','\0',' '),array('\\\\','\*','\(','\)','\\0','\20'),$string);
|
||||
}
|
||||
|
||||
// connect to the ldap server and return a handle
|
||||
/*!
|
||||
@function ldapConnect
|
||||
|
Loading…
Reference in New Issue
Block a user