From 230b06fca84f6ca0cb04b856977f952f36a68405 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 11 Apr 2006 12:08:45 +0000 Subject: [PATCH] Fixed dn cutting before / git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3033 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/functions.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/functions.inc b/include/functions.inc index 0c47bada4..b98e65917 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -791,7 +791,6 @@ function convert_department_dn($dn) function convert_department_dn2($dn) { $dep= ""; - /* Build a sub-directory style list of the tree level specified in $dn */ $deps = array_flip($_SESSION['config']->idepartments); @@ -800,7 +799,11 @@ function convert_department_dn2($dn) $dn= $deps[$dn]; $dep = preg_replace("/^.*=/","",$dn); }else{ - $dep= preg_replace("%^.*/([^/]+)$%", "\\1", $dn); + if(preg_match("/=/",$dn)){ + $dep= preg_replace("%^.*\/([^\/]+)$%", "\\1", $dn); + }else{ + $dep = $dn; + } } /* Return and remove accidently trailing slashes */ -- 2.30.2