Code

In some cases, eg. when a plugin isn't installed, we may receive an empty string...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 Nov 2010 10:49:08 +0000 (10:49 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 22 Nov 2010 10:49:08 +0000 (10:49 +0000)
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

index 34aff04a8e5652b6c00a9e61cb5bdb8df7dbb459..feda5169a54e8bb64a2e4718d87d100b41d29fb1 100644 (file)
@@ -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) {