From 8490014ffe2652b0065e3d3e0a68c3e9e0bdde4a Mon Sep 17 00:00:00 2001 From: alecpl Date: Thu, 14 Jan 2010 19:17:44 +0000 Subject: - better headers formatting --- program/steps/mail/headers.inc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'program/steps/mail/headers.inc') 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/', '    ', $source); - $source = preg_replace('/^([a-z0-9_:-]+)/im', ''.'\1'.'', $source); - $source = preg_replace('/\r?\n/', '
', $source); + $source = preg_replace( + array( + '/\n[\t\s]+/', + '/^([a-z0-9_:-]+)/im', + '/\r?\n/' + ), + array( + "\n    ", + '\1', + '
' + ), $source); $OUTPUT->command('set_headers', $source); $OUTPUT->send(); -- cgit v1.2.3