From fe5a50c39e9bd837f887ea7ad8335717a6c6ab92 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 5 Mar 2014 19:37:43 +0100 Subject: fix single line comments in CSS compression double slashes in url() always have to be ignored --- lib/exe/css.php | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) (limited to 'lib/exe/css.php') diff --git a/lib/exe/css.php b/lib/exe/css.php index cab7384b2..0a2a5a406 100644 --- a/lib/exe/css.php +++ b/lib/exe/css.php @@ -552,7 +552,7 @@ function css_compress($css){ $css = preg_replace_callback('#(/\*)(.*?)(\*/)#s','css_comment_cb',$css); //strip (incorrect but common) one line comments - $css = preg_replace('/(? Date: Wed, 5 Mar 2014 20:06:24 +0100 Subject: fixed online comment stripping --- lib/exe/css.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib/exe/css.php') diff --git a/lib/exe/css.php b/lib/exe/css.php index 0a2a5a406..178895e99 100644 --- a/lib/exe/css.php +++ b/lib/exe/css.php @@ -611,16 +611,11 @@ function css_onelinecomment_cb($matches) { $out .= substr($line, $i, $len-$i); break; } - if($nexturl === false) { + if($nexturl === false || $nextcom < $nexturl) { // no url anymore, strip comment and be done $out .= substr($line, $i, $nextcom-$i); break; } - if($nextcom < $nexturl) { - // that comment comments out the url - $out .= substr($line, $i, $len-$i); - break; - } // we have an upcoming url $urlclose = strpos($line, ')', $nexturl); $out .= substr($line, $i, $urlclose-$i); -- cgit v1.2.3