From: kink Date: Thu, 22 Dec 2005 23:01:54 +0000 (+0000) Subject: - MagicHTML fix for comments in styles. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5db902611e23f154906e1901a0df910f63874ffc;p=squirrelmail.git - MagicHTML fix for comments in styles. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10495 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/ChangeLog b/ChangeLog index 54b5d33c..42839e05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -511,6 +511,7 @@ Version 1.5.1 -- CVS - Fixed character wrapping/encoding issues in Japanese translation (#1377622). Issue is specific to sqBodyWrap() and string function wrappers introduced in 1.5.1. + - MagicHTML fix for comments in styles. Version 1.5.0 - 2 February 2004 ------------------------------- diff --git a/functions/mime.php b/functions/mime.php index 9dd61e3f..25c6239a 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -1746,11 +1746,12 @@ function sq_fixstyle($body, $pos, $message, $id, $mailbox){ * Fix stupid css declarations which lead to vulnerabilities * in IE. */ - $match = Array('/expression/i', + $match = Array('/\/\*.*\*\//', + '/expression/i', '/behaviou*r/i', '/binding/i', '/include-source/i'); - $replace = Array('idiocy', 'idiocy', 'idiocy', 'idiocy'); + $replace = Array('','idiocy', 'idiocy', 'idiocy', 'idiocy'); $contentNew = preg_replace($match, $replace, $contentTemp); if ($contentNew !== $contentTemp) { // insecure css declarations are used. From now on we don't care @@ -2148,6 +2149,7 @@ function magicHTML($body, $id, $message, $mailbox = 'INBOX', $take_mailto_links "/^style/i" => Array( Array( + "/\/\*.*\*\//", "/expression/i", "/binding/i", "/behaviou*r/i", @@ -2159,6 +2161,7 @@ function magicHTML($body, $id, $message, $mailbox = 'INBOX', $take_mailto_links "/(.*)\s*:\s*url\s*\(\s*([\'\"]*)\s*\S+script\s*:.*([\'\"]*)\s*\)/si" ), Array( + "", "idiocy", "idiocy", "idiocy",