summaryrefslogtreecommitdiff
path: root/program/steps/mail/sendmail.inc
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-09-21 11:24:16 +0200
committerAleksander Machniak <alec@alec.pl>2013-09-21 11:24:16 +0200
commitf7b2bfba092213af2f7101b18b96e957cbe0b217 (patch)
tree294af8a00516d41fe4c0989795a9e5d2539c8395 /program/steps/mail/sendmail.inc
parenta149d566fca224e503b7676337486ec2670e6cca (diff)
Bring back possibility to unset default font family and font size
Fix style attribute quoting when font-family contains double quotes SOme code improvements
Diffstat (limited to 'program/steps/mail/sendmail.inc')
-rw-r--r--program/steps/mail/sendmail.inc16
1 files changed, 11 insertions, 5 deletions
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index 3f4475e46..dee8d2136 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -473,13 +473,19 @@ $isHtml = (bool) get_input_value('_is_html', RCUBE_INPUT_POST);
$message_body = get_input_value('_message', RCUBE_INPUT_POST, TRUE, $message_charset);
if ($isHtml) {
- $font_family = rcube_fontdefs($RCMAIL->config->get('default_font', 'Arial'));
- $font_size = $RCMAIL->config->get('default_font_size');
- $bstyle = ' style="font:' . $font_size . ' ' . $font_family . ';"';
+ $bstyle = array();
+
+ if ($font_size = $RCMAIL->config->get('default_font_size')) {
+ $bstyle[] = 'font-size: ' . $font_size;
+ }
+ if ($font_family = $RCMAIL->config->get('default_font')) {
+ $bstyle[] = 'font-family: ' . rcmail::font_defs($font_family);
+ }
// append doctype and html/body wrappers
- $message_body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">' .
- "\r\n<html><body$bstyle>\r\n" . $message_body;
+ $message_body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">'
+ . "\r\n<html><body" . (!empty($bstyle) ? " style='" . implode($bstyle, '; ') . "'" : '') . ">\r\n"
+ . $message_body;
}
if (!$savedraft) {