From fcde3e48024efb918768d57431cc98450ab1fc80 Mon Sep 17 00:00:00 2001 From: cajus Date: Sat, 1 Nov 2008 18:02:53 +0000 Subject: [PATCH] Slight speedup for fix and convert (10%) git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12854 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_ldap.inc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/gosa-core/include/class_ldap.inc b/gosa-core/include/class_ldap.inc index 2a0055bee..8aa793cf1 100644 --- a/gosa-core/include/class_ldap.inc +++ b/gosa-core/include/class_ldap.inc @@ -90,11 +90,9 @@ class LDAP{ / => SL */ static function convert($dn) { - if (SPECIALS_OVERRIDE == TRUE){ - $tmp= preg_replace(array("/\\\\,/", "/\\\\2C/", "/\(/", "/\)/", "/\//"), - array("\001CO", "\001CO", "\001OB", "\001CB", "\001SL"), - $dn); - return (preg_replace('/,\s+/', ',', $tmp)); + if (SPECIALS_OVERRIDE === TRUE){ + return preg_replace('/,\s+/', ',', str_replace(array('\\\\,', '\\\\2C', '\(/', '/\)', '\/'), + array("\001CO", "\001CO", "\001OB", "\001CB", "\001SL"), $dn)); } else { return ($dn); } @@ -107,10 +105,9 @@ class LDAP{ servers seem to take it the correct way. */ static function fix($dn) { - if (SPECIALS_OVERRIDE == TRUE){ - return (preg_replace(array("/\001CO/", "/\001OB/", "/\001CB/", "/\001SL/"), - array("\,", "(", ")", "/"), - $dn)); + if (SPECIALS_OVERRIDE === TRUE){ + return (str_replace(array('\001CO', '\001OB', '\001CB', '\001SL'), + array('\,', '(', ')', '/'), $dn)); } else { return ($dn); } -- 2.30.2