summaryrefslogtreecommitdiff
path: root/program/include/main.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-01-29 14:55:12 +0000
committerthomascube <thomas@roundcube.net>2011-01-29 14:55:12 +0000
commit98cb0f179206843ceaa87df6bfb3d1da045ed8ad (patch)
treeade6196094997c24b48e8a432383bd2da9f6bc5c /program/include/main.inc
parenta32679e69f7d6c265f85015677743272740dcc8e (diff)
Apply bug fixes and localization updated from trunk for release 0.5.1
Diffstat (limited to 'program/include/main.inc')
-rw-r--r--program/include/main.inc9
1 files changed, 5 insertions, 4 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index b61f8aea2..b8d27d68c 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -861,8 +861,8 @@ function rcmail_mod_css_styles($source, $container_id)
$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))
+ $stripped = preg_replace('/[^a-z\(:;]/', '', rcmail_xss_entity_decode($source));
+ if (preg_match('/expression|behavior|url\(|import[^a]/', $stripped))
return '/* evil! */';
// remove css comments (sometimes used for some ugly hacks)
@@ -1771,16 +1771,17 @@ function rcube_sess_unset($var_name=null)
* Replaces hostname variables
*
* @param string $name Hostname
+ * @param string $host Optional IMAP hostname
* @return string
*/
-function rcube_parse_host($name)
+function rcube_parse_host($name, $host='')
{
// %n - host
$n = preg_replace('/:\d+$/', '', $_SERVER['SERVER_NAME']);
// %d - domain name without first part, e.g. %d=mail.domain.tld, %m=domain.tld
$d = preg_replace('/^[^\.]+\./', '', $n);
// %h - IMAP host
- $h = $_SESSION['imap_host'];
+ $h = $_SESSION['imap_host'] ? $_SESSION['imap_host'] : $host;
// %z - IMAP domain without first part, e.g. %h=imap.domain.tld, %z=domain.tld
$z = preg_replace('/^[^\.]+\./', '', $h);