From: cajus Date: Sat, 1 Nov 2008 18:02:53 +0000 (+0000) Subject: Slight speedup for fix and convert (10%) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fcde3e48024efb918768d57431cc98450ab1fc80;p=gosa.git Slight speedup for fix and convert (10%) git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12854 594d385d-05f5-0310-b6e9-bd551577e9d8 --- 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); }