diff --git a/trunk/includes/class/class.LSattr_html_select_object.php b/trunk/includes/class/class.LSattr_html_select_object.php index 30bed0a9..7ce6c5a7 100644 --- a/trunk/includes/class/class.LSattr_html_select_object.php +++ b/trunk/includes/class/class.LSattr_html_select_object.php @@ -91,7 +91,7 @@ class LSattr_html_select_object extends LSattr_html{ return; } - if (is_array($values)) { + if ((is_array($values))&&(!empty($values))) { if(($conf['value_attribute']=='dn')||($conf['value_attribute']=='%{dn}')) { $list=array(); foreach($values as $dn) { @@ -102,13 +102,20 @@ class LSattr_html_select_object extends LSattr_html{ } } else { - $filter='(|'; + $filter=''; foreach($values as $val) { - $filter.='('.$conf['value_attribute'].'='.$val.')'; + if (!empty($val)) { + $filter.='('.$conf['value_attribute'].'='.$val.')'; + } + } + if ($filter!='') { + $filter='(|'.$filter.')'; + $obj = new $conf['object_type'](); + $list = $obj -> listObjects($filter); + } + else { + $list=array(); } - $filter.=')'; - $obj = new $conf['object_type'](); - $list = $obj -> listObjects($filter); } if(($conf['value_attribute']=='dn')||($conf['value_attribute']=='%{dn}')) { for($i=0;$i getDisplayValue(); - if(!is_array($data)) + if((!is_array($data))&&($data!=NULL)) { $data=array($data); + } return $data; }