diff options
author | Thor (atiredmachine) <thor@bandwidthbeta.com> | 2012-01-25 07:08:36 +0100 |
---|---|---|
committer | Thor (atiredmachine) <thor@bandwidthbeta.com> | 2012-01-25 07:08:36 +0100 |
commit | 5de117549f69465a1ce0f2e128428d9adadd8a6d (patch) | |
tree | 40e7fdc29d82e8fe17242d35d660624f057573c8 /system/core/Output.php | |
parent | 1d0661a8bb4407ac9b0f9043f7952f8ffae8ee66 (diff) |
Strips out HTML comments.
Diffstat (limited to 'system/core/Output.php')
-rwxr-xr-x | system/core/Output.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/system/core/Output.php b/system/core/Output.php index 47c00acd8..8992fc1f1 100755 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -600,6 +600,9 @@ class CI_Output { // Replace multiple spaces with a single space. $output = preg_replace('!\s{2,}!',"\n",$output); + // Remove comments (non-MSIE conditionals) + $output = preg_replace('{\s*<!--[^\[].*-->\s*}msU','',$output); + // Remove spaces around block-level elements. $output = preg_replace('{\s*(</?(html|head|title|meta|script|link|style|body|h[1-6]|div|p|br).*>)\s*}', '$1', $output); |