summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-01-14 19:17:44 +0000
committeralecpl <alec@alec.pl>2010-01-14 19:17:44 +0000
commit8490014ffe2652b0065e3d3e0a68c3e9e0bdde4a (patch)
treede099df943d76737b5654354f49a0a93dc393633
parentcea5bc82ee658ecf7dbc5c806fc7445ad8c2a81d (diff)
- better headers formatting
-rw-r--r--program/steps/mail/headers.inc14
1 files changed, 11 insertions, 3 deletions
diff --git a/program/steps/mail/headers.inc b/program/steps/mail/headers.inc
index 653fb9647..247827afc 100644
--- a/program/steps/mail/headers.inc
+++ b/program/steps/mail/headers.inc
@@ -25,9 +25,17 @@ if ($uid = get_input_value('_uid', RCUBE_INPUT_POST))
if ($source)
{
$source = htmlspecialchars(trim($source));
- $source = preg_replace('/\t/', '&nbsp;&nbsp;&nbsp;&nbsp;', $source);
- $source = preg_replace('/^([a-z0-9_:-]+)/im', '<font class="bold">'.'\1'.'</font>', $source);
- $source = preg_replace('/\r?\n/', '<br />', $source);
+ $source = preg_replace(
+ array(
+ '/\n[\t\s]+/',
+ '/^([a-z0-9_:-]+)/im',
+ '/\r?\n/'
+ ),
+ array(
+ "\n&nbsp;&nbsp;&nbsp;&nbsp;",
+ '<font class="bold">\1</font>',
+ '<br />'
+ ), $source);
$OUTPUT->command('set_headers', $source);
$OUTPUT->send();