summaryrefslogtreecommitdiff
path: root/program/include/main.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-09-11 13:21:34 +0000
committeralecpl <alec@alec.pl>2010-09-11 13:21:34 +0000
commitcb3dfdfedef18381a30fd9b80c9f7120af1031a4 (patch)
treea5f3dd0c856bea2bfb8a44f3b518b5ce040f44dd /program/include/main.inc
parent618cb0d8dde52c2c8a181334e7a3c33fbc26c236 (diff)
- Fix messages background image handling in some cases (#1486990)
Diffstat (limited to 'program/include/main.inc')
-rw-r--r--program/include/main.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index 501a80fa7..e3004d048 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -845,7 +845,7 @@ function rcmail_mod_css_styles($source, $container_id)
{
$last_pos = 0;
$replacements = new rcube_string_replacer;
-
+
// ignore the whole block if evil styles are detected
$stripped = preg_replace('/[^a-z\(:]/', '', rcmail_xss_entity_decode($source));
if (preg_match('/expression|behavior|url\(|import/', $stripped))
@@ -868,15 +868,15 @@ function rcmail_mod_css_styles($source, $container_id)
array(
'/(^\s*<!--)|(-->\s*$)/',
'/(^\s*|,\s*|\}\s*)([a-z0-9\._#\*][a-z0-9\.\-_]*)/im',
- "/$container_id\s+body/i",
+ '/'.preg_quote($container_id, '/').'\s+body/i',
),
array(
'',
"\\1#$container_id \\2",
- "$container_id div.rcmBody",
+ $container_id,
),
$source);
-
+
// put block contents back in
$styles = $replacements->resolve($styles);