Aleksander Machniak
2013-05-23 2f39634b0a31ce4d764c0e44b4eb2dcc144b3a4a
Fix invalid option selected in default_font selector when font is unset (#1489112)
5 files modified
16 ■■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
config/main.inc.php.dist 2 ●●● patch | view | raw | blame | history
program/steps/mail/compose.inc 2 ●●● patch | view | raw | blame | history
program/steps/mail/sendmail.inc 2 ●●● patch | view | raw | blame | history
program/steps/settings/func.inc 9 ●●●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,7 @@
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 browser warnings on PDF plugin detection (#1489118)
- Fix fatal error when parsing UUencoded messages (#1489119)
config/main.inc.php.dist
@@ -888,6 +888,6 @@
// Default font for composed HTML message.
// Supported values: Andale Mono, Arial, Arial Black, Book Antiqua, Courier New,
// Georgia, Helvetica, Impact, Tahoma, Terminal, Times New Roman, Trebuchet MS, Verdana
$rcmail_config['default_font'] = '';
$rcmail_config['default_font'] = 'Verdana';
// end of config file
program/steps/mail/compose.inc
@@ -143,7 +143,7 @@
$OUTPUT->set_env('recipients_separator', trim($RCMAIL->config->get('recipients_separator', ',')));
// 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)) {
  $OUTPUT->set_env('default_font', $font);
}
program/steps/mail/sendmail.inc
@@ -479,7 +479,7 @@
$message_body = get_input_value('_message', RCUBE_INPUT_POST, TRUE, $message_charset);
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'" : '';
  // append doctype and html/body wrappers
program/steps/settings/func.inc
@@ -653,14 +653,15 @@
    }
    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>';