summaryrefslogtreecommitdiff
path: root/lib/exe/css.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-01-21 12:47:30 +0100
committerAndreas Gohr <andi@splitbrain.org>2006-01-21 12:47:30 +0100
commit247c1c5d1105cce361fd81b965640bc8e25aa09e (patch)
tree80a2641de8a93cd689428fce68ac07db94328960 /lib/exe/css.php
parent3aa54d7c9ec9ff4a63d08b2b25bdf7483f8d3e79 (diff)
downloadrpg-247c1c5d1105cce361fd81b965640bc8e25aa09e.tar.gz
rpg-247c1c5d1105cce361fd81b965640bc8e25aa09e.tar.bz2
strip (incorrect but common) one line comments in CSS compressor
darcs-hash:20060121114730-7ad00-773f787251a52d230aee9078fb2c974ffe37599a.gz
Diffstat (limited to 'lib/exe/css.php')
-rw-r--r--lib/exe/css.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/exe/css.php b/lib/exe/css.php
index 1c265b449..5973991ef 100644
--- a/lib/exe/css.php
+++ b/lib/exe/css.php
@@ -241,6 +241,9 @@ function css_pluginstyles($mode='screen'){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function css_compress($css){
+ //strip (incorrect but common) one line comments
+ $css = preg_replace('!//.*$!m','',$css);
+
// strip whitespaces
$css = preg_replace('![\r\n\t ]+!',' ',$css);
$css = preg_replace('/ ?([:;,{}\/]) ?/','\\1',$css);