Code

Added function to prepare4ldap
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 15 Jan 2008 13:26:54 +0000 (13:26 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 15 Jan 2008 13:26:54 +0000 (13:26 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@8356 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_ldap.inc

index ebc8444514a005591e0a2ce58602245ecbf172b4..223d0de12c9283e2f7221626a8a3bc93119166bf 100644 (file)
@@ -94,6 +94,14 @@ class LDAP{
   }
 
 
+  /* Function to fix problematic characters in DN's that are used for search
+     requests. I.e. member=....                                               */
+  static function prepare4filter($dn)
+  {
+        return normalizeLdap(preg_replace('/\\\\/', '\\\\\\', LDAP::fix($dn)));
+  }
+
+
   function connect()
   {
     $this->hascon=false;