From 449f009b39e961856d49069a07e56902f439efd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Rouleau?= Date: Thu, 20 Jul 2017 20:34:49 -0400 Subject: [PATCH] Fix issue where minify() would corrupt Unicode characters (such as  ) in some environments Adding the `u` flag there fixes an issue in my environment (MAMP 4.1.1 with PHP 7.1.5) where `minify()` would corrupt the ` ` character (it would get replaced by the replacement character). --- lib/Minify/HTML.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Minify/HTML.php b/lib/Minify/HTML.php index 0cabbfb..0eb9565 100644 --- a/lib/Minify/HTML.php +++ b/lib/Minify/HTML.php @@ -135,7 +135,7 @@ class Minify_HTML .'|canvas|caption|center|col(?:group)?|dd|dir|div|dl|dt|fieldset|figcaption|figure|footer|form' .'|frame(?:set)?|h[1-6]|head|header|hgroup|hr|html|legend|li|link|main|map|menu|meta|nav' .'|ol|opt(?:group|ion)|output|p|param|section|t(?:able|body|head|d|h||r|foot|itle)' - .'|ul|video)\\b[^>]*>)/i', '$1', $this->_html); + .'|ul|video)\\b[^>]*>)/iu', '$1', $this->_html); // remove ws outside of all elements $this->_html = preg_replace(