Code

$classes may be null
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 21 Apr 2006 08:41:09 +0000 (08:41 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 21 Apr 2006 08:41:09 +0000 (08:41 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3080 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/generic/references/class_reference.inc

index 43d945dbeb41c00b70c0929018b7f1cb0f87561b..3f53973be357e1e011b07604b88f2ddc1dbcc625 100644 (file)
@@ -154,11 +154,13 @@ class reference extends plugin
   function createContentString($classes)
   {
        $result= "";
-       foreach ($classes as $class){
-               if (isset($this->obtypes[$class])){
-                       $result.= "<a><img alt=\"\" border=0 src='images/".$this->obtypes[$class]['image']."'>&nbsp;".$this->obtypes[$class]['text']."</a> ";
+       if(!is_null($classes)) {
+               foreach ($classes as $class){
+                       if (isset($this->obtypes[$class])){
+                               $result.= "<a><img alt=\"\" border=0 src='images/".$this->obtypes[$class]['image']."'>&nbsp;".$this->obtypes[$class]['text']."</a> ";
+                       }
                }
-       }       
+       }
        return (preg_replace('/ $/', '', $result));
   }