diff options
| author | estadtherr <estadtherr@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-02-26 06:51:39 +0000 |
|---|---|---|
| committer | estadtherr <estadtherr@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-02-26 06:51:39 +0000 |
| commit | 4c7f79426f3b48b00bd50e42d65b6732ce018299 (patch) | |
| tree | a45b9794985ed523b3cef2c08532c84d246357f9 /roundcubemail/program/include | |
| parent | 9f8425691a7f5ab94da1723ced650f14ac6efe2c (diff) | |
fixed check for selected value in value array in rcube_shared::select
git-svn-id: https://svn.roundcube.net/trunk@497 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
| -rw-r--r-- | roundcubemail/program/include/rcube_shared.inc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/roundcubemail/program/include/rcube_shared.inc b/roundcubemail/program/include/rcube_shared.inc index a26fc108b..ba63c825f 100644 --- a/roundcubemail/program/include/rcube_shared.inc +++ b/roundcubemail/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</%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>%s', $this->_conv_case('select', 'tag'), |
