From 7f5569626475b2c16b98815377c8420bbaa67b60 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 22 Nov 2010 10:49:08 +0000 Subject: [PATCH] In some cases, eg. when a plugin isn't installed, we may receive an empty string when calling get('...'); This leads to errors in the the ldap filtering class. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20316 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_filterLDAP.inc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gosa-core/include/class_filterLDAP.inc b/gosa-core/include/class_filterLDAP.inc index 34aff04a8..feda5169a 100644 --- a/gosa-core/include/class_filterLDAP.inc +++ b/gosa-core/include/class_filterLDAP.inc @@ -35,6 +35,13 @@ class filterLDAP { $bases[$base]= ""; } else { foreach ($objectStorage as $oc) { + + // Handle empty storage locatios here, maybe get_ou() as returned an empty string. + if(empty($oc)){ + $bases[$base] = ""; + continue; + } + $oc= preg_replace('/,$/', '', $oc); $tmp= explode(',', $oc); if (count($tmp) == 1) { -- 2.30.2