Code

Updated filter initialization
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Mar 2010 08:57:34 +0000 (08:57 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 10 Mar 2010 08:57:34 +0000 (08:57 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16365 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_filterEditor.inc

index 92a0621e9bb2cf253dca2a2e9e77c7164cb59b7a..9c779ef2498a2374ad722410b3ef6ad556c59014 100644 (file)
@@ -29,12 +29,30 @@ class filterEditor extends plugin
     if(isset($this->attrs['gosaUserDefinedFilter'])){
       for($i=0; $i< $this->attrs['gosaUserDefinedFilter']['count']; $i++){
         list($categories, $name, $description, $filter, $flags) = split(";", $this->attrs['gosaUserDefinedFilter'][$i]);
+   
+        // Ensure that we no empty category in our category list.
+        if(empty($categories)){
+          $categories = array();
+        }else{
+          $categories = split(',', $categories);
+        }
+
+        // Ensure that we no empty entry in out flags list.
+        if(empty($flags)){
+          $flags = array();
+        }else{
+          $flags = split(',', $flags);
+        }
+
+        // build up filter entry.
         $tmp = array(
             'name' => $name, 
-            'categories' => split(',', $categories),
+            'categories' => $categories,
             'description' => base64_decode($description),
             'filter' => base64_decode($filter),
-            'flags' => split(',',$flags));
+            'flags' => $flags);
+
+
         $this->filters[$name] = $tmp; 
       }
     }