summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorsvncommit <devs@roundcube.net>2007-02-26 06:51:39 +0000
committersvncommit <devs@roundcube.net>2007-02-26 06:51:39 +0000
commite17702395e1aa0fa54eea36817e1150c231d49eb (patch)
tree5b443b7988130ad290a9d69462a75c7576afb421 /program
parentd16ddb753ff5573279b3eb483dc97d8d16865fd9 (diff)
fixed check for selected value in value array in rcube_shared::select
Diffstat (limited to 'program')
-rw-r--r--program/include/rcube_shared.inc12
-rw-r--r--program/steps/mail/compose.inc2
2 files changed, 8 insertions, 6 deletions
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</%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'),
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 211f9fbe8..1c2639d9b 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -766,7 +766,7 @@ function rcmail_priority_selector($attrib)
rcube_label('highest')),
array(5, 4, 0, 2, 1));
- $sel = isset($_POST['_priority']) ? $_POST['_priority'] : rcube_label('normal');
+ $sel = isset($_POST['_priority']) ? $_POST['_priority'] : 0;
$out = $form_start ? "$form_start\n" : '';
$out .= $selector->show($sel);