diff options
author | Andreas Gohr <andi@splitbrain.org> | 2006-01-22 13:46:13 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2006-01-22 13:46:13 +0100 |
commit | fd7c2db0d17e5b53981fef40fe9e3eca46b34038 (patch) | |
tree | c083768128839c2c61702db007f7b4646e8a3a43 /lib | |
parent | bf5e5a5ba7408165918eb7d2398680ff245a48bb (diff) | |
download | rpg-fd7c2db0d17e5b53981fef40fe9e3eca46b34038.tar.gz rpg-fd7c2db0d17e5b53981fef40fe9e3eca46b34038.tar.bz2 |
CSS compressor fix
darcs-hash:20060122124613-7ad00-41ed03a1d6668874a324db8bc98aee72ab90e277.gz
Diffstat (limited to 'lib')
-rw-r--r-- | lib/exe/css.php | 8 |
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); |