Fix invalid option selected in default_font selector when font is unset (#1489112)

pull/74/head
Aleksander Machniak 11 years ago
parent 6ae92aa169
commit 07795ba124

@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail CHANGELOG Roundcube Webmail
=========================== ===========================
- Fix invalid option selected in default_font selector when font is unset (#1489112)
- Fix displaying contact with ID divisible by 100 in sql addressbook (#1489121) - Fix displaying contact with ID divisible by 100 in sql addressbook (#1489121)
- Fix browser warnings on PDF plugin detection (#1489118) - Fix browser warnings on PDF plugin detection (#1489118)
- Fix fatal error when parsing UUencoded messages (#1489119) - Fix fatal error when parsing UUencoded messages (#1489119)

@ -888,7 +888,7 @@ $rcmail_config['autocomplete_single'] = false;
// Default font for composed HTML message. // Default font for composed HTML message.
// Supported values: Andale Mono, Arial, Arial Black, Book Antiqua, Courier New, // Supported values: Andale Mono, Arial, Arial Black, Book Antiqua, Courier New,
// Georgia, Helvetica, Impact, Tahoma, Terminal, Times New Roman, Trebuchet MS, Verdana // Georgia, Helvetica, Impact, Tahoma, Terminal, Times New Roman, Trebuchet MS, Verdana
$rcmail_config['default_font'] = ''; $rcmail_config['default_font'] = 'Verdana';
// Enables display of email address with name instead of a name (and address in title) // Enables display of email address with name instead of a name (and address in title)
$rcmail_config['message_show_email'] = false; $rcmail_config['message_show_email'] = false;

@ -143,7 +143,7 @@ $OUTPUT->set_env('top_posting', intval($RCMAIL->config->get('reply_mode')) > 0);
$OUTPUT->set_env('recipients_separator', trim($RCMAIL->config->get('recipients_separator', ','))); $OUTPUT->set_env('recipients_separator', trim($RCMAIL->config->get('recipients_separator', ',')));
// default font for HTML editor // default font for HTML editor
$font = rcube_fontdefs($RCMAIL->config->get('default_font', 'Verdana')); $font = rcube_fontdefs($RCMAIL->config->get('default_font'));
if ($font && !is_array($font)) { if ($font && !is_array($font)) {
$OUTPUT->set_env('default_font', $font); $OUTPUT->set_env('default_font', $font);
} }

@ -479,7 +479,7 @@ $isHtml = (bool) get_input_value('_is_html', RCUBE_INPUT_POST);
$message_body = get_input_value('_message', RCUBE_INPUT_POST, TRUE, $message_charset); $message_body = get_input_value('_message', RCUBE_INPUT_POST, TRUE, $message_charset);
if ($isHtml) { if ($isHtml) {
$font = rcube_fontdefs($RCMAIL->config->get('default_font', 'Verdana')); $font = rcube_fontdefs($RCMAIL->config->get('default_font'));
$bstyle = $font && is_string($font) ? " style='font-family: $font'" : ''; $bstyle = $font && is_string($font) ? " style='font-family: $font'" : '';
// append doctype and html/body wrappers // append doctype and html/body wrappers

@ -664,14 +664,15 @@ function rcmail_user_prefs($current=null)
} }
if (!isset($no_override['default_font'])) { if (!isset($no_override['default_font'])) {
$field_id = 'rcmfd_default_font'; $field_id = 'rcmfd_default_font';
$fonts = rcube_fontdefs(); $fonts = rcube_fontdefs();
$default_font = $config['default_font'] ? $config['default_font'] : 'Verdana'; $selected = $config['default_font'];
$select = '<select name="_default_font" id="'.$field_id.'">'; $select = '<select name="_default_font" id="'.$field_id.'">';
$select .= '<option value=""' . (!$selected ? ' selected="selected"' : '') . '>---</option>';
foreach ($fonts as $fname => $font) foreach ($fonts as $fname => $font)
$select .= '<option value="'.$fname.'"' $select .= '<option value="'.$fname.'"'
. ($fname == $default_font ? ' selected="selected"' : '') . ($fname == $selected ? ' selected="selected"' : '')
. ' style=\'font-family: ' . $font . '\'>' . ' style=\'font-family: ' . $font . '\'>'
. Q($fname) . '</option>'; . Q($fname) . '</option>';
$select .= '</select>'; $select .= '</select>';

Loading…
Cancel
Save