r7049 보완. 주석 제거는 하지 않음.; (위험 부담이 큼;)

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7059 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
misol 2009-12-20 13:26:36 +00:00
parent a21b9b5380
commit 227e9646b6

View file

@ -157,7 +157,7 @@
unset($str);
}
$str_to_write = $this->doCompressCode($str_to_write);
$str_to_write = $this->doCompressCode($str_to_write, $type);
$file_object->write($str_to_write);
$file_object->close();
@ -251,14 +251,10 @@ if(!$cached) {
return 'url("'.$target.'")';
}
function doCompressCode($str_code) {
function doCompressCode($str_code, $type) {
$str_code = str_replace("\r", "\n", $str_code);
$str_code = preg_replace("!\/\*([^\"']*?)\*\/!sm", '', $str_code);
$str_code = preg_replace("!^([ \t]+)!m", '', $str_code);
$str_code = preg_replace("!([ \t]+)$!m", '', $str_code);
$str_code = preg_replace("!^\/\*([^/]*?)\*\/$!sm", '', $str_code);
$str_code = preg_replace("!^\/\*([^*]*?)\*\/$!sm", '', $str_code);
$str_code = preg_replace("!^\/\/([^\n'\"]*)$!m", '', $str_code);
$str_code = preg_replace("!(\n{2,})!m", "\n", $str_code);
return trim($str_code);