summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps/mail
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2006-12-23 11:16:53 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2006-12-23 11:16:53 +0000
commit387952f46dbb8869566bf3c906a31d4c2bee0ef7 (patch)
treed0d0c1c53f4e0a3562198204c41aef0f0990c19b /roundcubemail/program/steps/mail
parent2930c5aca786775dd66ad646de619197c2e6a74a (diff)
Fixed little typos and improved CSS altering in HTML messages
git-svn-id: https://svn.roundcube.net/trunk@432 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail')
-rw-r--r--roundcubemail/program/steps/mail/func.inc14
1 files changed, 7 insertions, 7 deletions
diff --git a/roundcubemail/program/steps/mail/func.inc b/roundcubemail/program/steps/mail/func.inc
index 57f20e57a..257502e15 100644
--- a/roundcubemail/program/steps/mail/func.inc
+++ b/roundcubemail/program/steps/mail/func.inc
@@ -1274,13 +1274,13 @@ function rcmail_mod_css_styles($source, $container_id)
$source = substr($source, 0, $pos+1) . "<<str_replacement[$key]>>" . substr($source, $pos2, strlen($source)-$pos2);
$last_pos = $pos+2;
}
-
- $styles = preg_replace('/(^\s*|,\s*)([a-z0-9\._][a-z0-9\.\-_]*)/im', "\\1#$container_id \\2", $source);
- $styles = preg_replace('/<<str_replacement\[([0-9]+)\]>>/e', "\$a_css_values[\\1]", $styles);
-
- // replace body definition because we also stripped off the <body> tag
- $styles = preg_replace("/$container_id\s+body/i", "$container_id div.rcmBody", $styles);
-
+
+ // remove html commends and add #container to each tag selector.
+ // also replace body definition because we also stripped off the <body> tag
+ $styles = preg_replace(array('/(^\s*<!--)|(-->\s*$)/', '/(^\s*|,\s*|\}\s*)([a-z0-9\._][a-z0-9\.\-_]*)/im', '/<<str_replacement\[([0-9]+)\]>>/e', "/$container_id\s+body/i"),
+ array('', "\\1#$container_id \\2", "\$a_css_values[\\1]", "$container_id div.rcmBody"),
+ $source);
+
return $styles;
}