From 0f607be23a4faa5d4ed761d8b158e1f2a944702e Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Thu, 2 Apr 2020 15:45:11 -0400 Subject: [PATCH] Exclude SSI Comments (#670) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Exclude SSI comments Exclude Nginx & Apache Server Side Include (SSI) comments from being stripped via minification, the same way IE directives are not stripped. Both Nginx & Apache SSI directives begin with: --- lib/Minify/HTML.php | 2 +- tests/_test_files/html/before.html | 11 ++++++++--- tests/_test_files/html/before.min.html | 7 ++++++- tests/_test_files/html/before2.html | 11 ++++++++--- tests/_test_files/html/before2.min.html | 7 ++++++- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/lib/Minify/HTML.php b/lib/Minify/HTML.php index df648e1..5dfb095 100644 --- a/lib/Minify/HTML.php +++ b/lib/Minify/HTML.php @@ -164,7 +164,7 @@ class Minify_HTML protected function _commentCB($m) { - return (0 === strpos($m[1], '[') || false !== strpos($m[1], ' css Zen Garden: The Beauty in CSS Design + + + + + + + + +