Fixed issues where HTML comments inside style tag would hang Internet Explorer
| | |
| | | CHANGELOG Roundcube Webmail |
| | | =========================== |
| | | |
| | | - Fixed issues where HTML comments inside style tag would hang Internet Explorer |
| | | - Improved mailto: link arguments handling (#1489363) |
| | | - Use DOMDocument LIBXML_PARSEHUGE and LIBXML_COMPACT options if possible (#1489302) |
| | | - Support HTTP_HOST, SERVER_NAME and SERVER_ADDR values in include_host_config feature |
| | |
| | | |
| | | // 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( |
| | | $source = preg_replace( |
| | | array( |
| | | '/(^\s*<!--)|(-->\s*$)/', |
| | | '/(^\s*<\!--)|(-->\s*$)/m', |
| | | '/(^\s*|,\s*|\}\s*)([a-z0-9\._#\*][a-z0-9\.\-_]*)/im', |
| | | '/'.preg_quote($container_id, '/').'\s+body/i', |
| | | ), |
| | |
| | | $source); |
| | | |
| | | // put block contents back in |
| | | $styles = $replacements->resolve($styles); |
| | | $source = $replacements->resolve($source); |
| | | |
| | | return $styles; |
| | | return $source; |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | // fix (unknown/malformed) HTML tags before "wash" |
| | | $html = preg_replace_callback('/(<[\/]*)([^\s>]+)/', array($this, 'html_tag_callback'), $html); |
| | | $html = preg_replace_callback('/(<(?!\!)[\/]*)([^\s>]+)/', array($this, 'html_tag_callback'), $html); |
| | | |
| | | // Remove invalid HTML comments (#1487759) |
| | | // Don't remove valid conditional comments |