diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-12-10 01:33:58 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-12-10 01:33:58 +0000 |
| commit | 787cc568ceab1a97db843cf001ddb612ce2b3f9e (patch) | |
| tree | faf29f4a0a497598e7800c4376c484c8f46556b9 /roundcubemail/program/steps/mail/func.inc | |
| parent | f8b839f79aed1eb5a843fe165bff581390a5480d (diff) | |
Better CSS url() validation
git-svn-id: https://svn.roundcube.net/trunk@5589 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/func.inc')
| -rw-r--r-- | roundcubemail/program/steps/mail/func.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/roundcubemail/program/steps/mail/func.inc b/roundcubemail/program/steps/mail/func.inc index a0a4dcab7..2bc0091cb 100644 --- a/roundcubemail/program/steps/mail/func.inc +++ b/roundcubemail/program/steps/mail/func.inc @@ -834,8 +834,8 @@ function rcmail_washtml_callback($tagname, $attrib, $content, $washtml) $stripped = preg_replace('/[^a-zA-Z\(:;]/', '', rcmail_xss_entity_decode($content)); // now check for evil strings like expression, behavior or url() - if (!preg_match('/expression|behavior/i', $stripped)) { - if (!$washtml->get_config('allow_remote') && preg_match('/url\(|import[^a]/i', $stripped)) + if (!preg_match('/expression|behavior|javascript:|import[^a]/i', $stripped)) { + if (!$washtml->get_config('allow_remote') && stripos($stripped, 'url(')) $washtml->extlinks = true; else $out = html::tag('style', array('type' => 'text/css'), $content); |
