From e17702395e1aa0fa54eea36817e1150c231d49eb Mon Sep 17 00:00:00 2001 From: svncommit Date: Mon, 26 Feb 2007 06:51:39 +0000 Subject: fixed check for selected value in value array in rcube_shared::select --- program/include/rcube_shared.inc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'program/include') diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc index a26fc108b..ba63c825f 100644 --- a/program/include/rcube_shared.inc +++ b/program/include/rcube_shared.inc @@ -1009,20 +1009,22 @@ class select extends base_form_element if (!is_array($select)) $select = array((string)$select); - + foreach ($this->options as $option) { - $selected = ((!empty($option['value']) && in_array($option['value'], $select, TRUE)) || - (in_array($option['text'], $select, TRUE))) ? $this->_conv_case(' selected', 'attrib') : ''; + $selected = ((isset($option['value']) && + in_array($option['value'], $select, TRUE)) || + (in_array($option['text'], $select, TRUE))) ? + $this->_conv_case(' selected', 'attrib') : ''; $options_str .= sprintf("<%s%s%s>%s\n", $this->_conv_case('option', 'tag'), - !empty($option['value']) ? sprintf($value_str, $option['value']) : '', + isset($option['value']) ? sprintf($value_str, $option['value']) : '', $selected, Q($option['text'], 'strict', FALSE), $this->_conv_case('option', 'tag')); } - + // return final tag return sprintf('<%s%s>%s%s', $this->_conv_case('select', 'tag'), -- cgit v1.2.3