diff --git a/components/CSS.php b/components/CSS.php index 6fef17a..f088fb7 100644 --- a/components/CSS.php +++ b/components/CSS.php @@ -165,16 +165,8 @@ protected function process(array $files) protected function removeCssComments(&$code) { if (true === $this->view->removeComments) { - - //https://stackoverflow.com/questions/1581049/preg-replace-out-css-comments - $regex = array( - "`^([\t\s]+)`ism"=>'', - "`^\/\*(.+?)\*\/`ism"=>"", - "`([\n\A;]+)\/\*(.+?)\*\/`ism"=>"$1", - "`([\n\A;\s]+)//(.+?)[\n\r]`ism"=>"$1\n", - "`(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+`ism"=>"\n" - ); - $code = preg_replace(array_keys($regex),$regex,$code); + //https://stackoverflow.com/a/3984887 + $code = preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!' , '' , $code ); } }