From: cajus Date: Wed, 12 Apr 2006 15:45:26 +0000 (+0000) Subject: Added fixes for several special characters X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ff4f658dc25181eaa0123471f80b1e5ca84f3873;p=gosa.git Added fixes for several special characters git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3041 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_config.inc b/include/class_config.inc index 6169f48c1..4c3161a88 100644 --- a/include/class_config.inc +++ b/include/class_config.inc @@ -529,7 +529,7 @@ class config { } /* Fix name, if it contains a replace tag */ - $name= preg_replace('/###GOSAREPLACED###/', ',', $name); + $name= @ldap::fix($name); /* Check if current name is too long, then cut it */ if(strlen($name)> $max_size){ diff --git a/include/class_ldap.inc b/include/class_ldap.inc index 96ff38e20..ad98c710b 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -48,6 +48,10 @@ class LDAP{ if (COLON_OVERRIDE == TRUE){ $res= preg_replace("/\\\\,/", '###GOSAREPLACED###', $dn); $res= preg_replace("/\\\\2C/", '###GOSAREPLACED###', $res); + $res= preg_replace("/\(/", '###OPENBRACE###', $res); + $res= preg_replace("/\)/", '###CLOSEBRACE###', $res); + $res= preg_replace("/\//", '###SLASH###', $res); + #if ($dn != $res){ # echo "Conversation from '$dn' to '$res'
"; #} @@ -62,6 +66,10 @@ class LDAP{ { if (COLON_OVERRIDE == TRUE){ $res= preg_replace("/###GOSAREPLACED###/", '\,', $dn); + $res= preg_replace("/###OPENBRACE###/", '(', $res); + $res= preg_replace("/###CLOSEBRACE###/", ')', $res); + $res= preg_replace("/###SLASH###/", '/', $res); + #if ($dn != $res){ # echo "Fix from '$dn' to '$res'
"; #} @@ -592,6 +600,7 @@ class LDAP{ if ($target == $this->basedn){ return; } +echo "FIXME"; $l= array_reverse(explode(",", preg_replace("/,".$this->basedn."/", "", $target))); $cdn= $this->basedn; foreach ($l as $part){ diff --git a/include/functions.inc b/include/functions.inc index 0c47bada4..807fbb636 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -781,9 +781,6 @@ function convert_department_dn($dn) } } - /* Fix name, if it contains a replace tag */ - $dep= preg_replace('/###GOSAREPLACED###/', ',', $dep); - /* Return and remove accidently trailing slashes */ return rtrim($dep, "/"); } @@ -805,7 +802,7 @@ function convert_department_dn2($dn) /* Return and remove accidently trailing slashes */ $tmp = rtrim($dep, "/"); - return $tmp; + return @ldap::fix($tmp); }