diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-05-23 18:47:23 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-05-23 18:48:24 +0200 |
commit | 2f39634b0a31ce4d764c0e44b4eb2dcc144b3a4a (patch) | |
tree | de22a5a94d1c58d8b1bf27d603d88ba37927fe5d /program/steps/settings | |
parent | e3cbe5dd62d9438433b039d682bd8b8215cc1d69 (diff) |
Fix invalid option selected in default_font selector when font is unset (#1489112)
Diffstat (limited to 'program/steps/settings')
-rw-r--r-- | program/steps/settings/func.inc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 319c58db9..981d4e406 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -653,14 +653,15 @@ function rcmail_user_prefs($current=null) } if (!isset($no_override['default_font'])) { - $field_id = 'rcmfd_default_font'; - $fonts = rcube_fontdefs(); - $default_font = $config['default_font'] ? $config['default_font'] : 'Verdana'; + $field_id = 'rcmfd_default_font'; + $fonts = rcube_fontdefs(); + $selected = $config['default_font']; $select = '<select name="_default_font" id="'.$field_id.'">'; + $select .= '<option value=""' . (!$selected ? ' selected="selected"' : '') . '>---</option>'; foreach ($fonts as $fname => $font) $select .= '<option value="'.$fname.'"' - . ($fname == $default_font ? ' selected="selected"' : '') + . ($fname == $selected ? ' selected="selected"' : '') . ' style=\'font-family: ' . $font . '\'>' . Q($fname) . '</option>'; $select .= '</select>'; |