diff options
author | thomascube <thomas@roundcube.net> | 2010-06-18 11:50:19 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2010-06-18 11:50:19 +0000 |
commit | 8e5ed7be9e754dfca0278653002ec75f9199d8a9 (patch) | |
tree | 0c81efe894b37f5b40e00983a902ef7f4dc44a4b /program | |
parent | f865b68205376ce90ac6edf15147400f1f4f3187 (diff) |
Strip comments in css string + don't set font color to tags
Diffstat (limited to 'program')
-rw-r--r-- | program/include/main.inc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/program/include/main.inc b/program/include/main.inc index cd53854ca..7c506d9e6 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -830,6 +830,9 @@ function rcmail_mod_css_styles($source, $container_id) if (preg_match('/expression|behavior|url\(|import/', $stripped)) return '/* evil! */'; + // remove css comments (sometimes used for some ugly hacks) + $source = preg_replace('!/\*(.+)\*/!Ums', '', $source); + // cut out all contents between { and } while (($pos = strpos($source, '{', $last_pos)) && ($pos2 = strpos($source, '}', $pos))) { @@ -837,7 +840,7 @@ function rcmail_mod_css_styles($source, $container_id) $source = substr($source, 0, $pos+1) . $replacements->get_replacement($key) . substr($source, $pos2, strlen($source)-$pos2); $last_pos = $pos+2; } - + // remove html comments and add #container to each tag selector. // also replace body definition because we also stripped off the <body> tag $styles = preg_replace( |