summaryrefslogtreecommitdiff
path: root/lib/exe/css.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/exe/css.php')
-rw-r--r--lib/exe/css.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/exe/css.php b/lib/exe/css.php
index 5973991ef..715d32885 100644
--- a/lib/exe/css.php
+++ b/lib/exe/css.php
@@ -241,16 +241,16 @@ function css_pluginstyles($mode='screen'){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function css_compress($css){
+ //strip comments through a callback
+ $css = preg_replace_callback('#(/\*)(.*?)(\*/)#s','css_comment_cb',$css);
+
//strip (incorrect but common) one line comments
- $css = preg_replace('!//.*$!m','',$css);
+ $css = preg_replace('/(?<!:)\/\/.*$/m','',$css);
// strip whitespaces
$css = preg_replace('![\r\n\t ]+!',' ',$css);
$css = preg_replace('/ ?([:;,{}\/]) ?/','\\1',$css);
- //strip comments through a callback
- $css = preg_replace_callback('#(/\*)(.*?)(\*/)#s','css_comment_cb',$css);
-
// shorten colors
$css = preg_replace("/#([0-9a-fA-F]{1})\\1([0-9a-fA-F]{1})\\2([0-9a-fA-F]{1})\\3/", "#\\1\\2\\3",$css);