From 5bf86c83c2b78e279bc18e9eecb3d39e8eb95b3c Mon Sep 17 00:00:00 2001 From: zero Date: Tue, 2 Oct 2007 03:50:23 +0000 Subject: [PATCH] =?UTF-8?q?Safari=20=EB=B8=8C=EB=9D=BC=EC=9A=B0=EC=A0=80?= =?UTF-8?q?=EC=97=90=EC=84=9C=20behavor=EC=9D=98=20=EC=86=8D=EC=84=B1?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=9D=B8=ED=95=B4=20=ED=86=B5=ED=95=A9=20?= =?UTF-8?q?css=ED=8C=8C=EC=9D=BC=EC=9D=84=20=EC=A0=9C=EB=8C=80=EB=A1=9C=20?= =?UTF-8?q?=ED=95=B4=EC=84=9D=ED=95=98=EC=A7=80=20=EB=AA=BB=ED=95=98?= =?UTF-8?q?=EB=8D=98=20=EB=AC=B8=EC=A0=9C=EB=A5=BC=20=ED=95=B4=EA=B2=B0?= =?UTF-8?q?=ED=95=98=EA=B8=B0=20=EC=9C=84=ED=95=B4=20button.css=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=EC=9D=80=20=ED=86=B5=ED=95=A9=20css=EC=97=90?= =?UTF-8?q?=20=EC=86=8D=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2662 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/file/FileHandler.class.php | 1 + classes/optimizer/Optimizer.class.php | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/classes/file/FileHandler.class.php b/classes/file/FileHandler.class.php index 4bcb124b6..a2209f3ed 100644 --- a/classes/file/FileHandler.class.php +++ b/classes/file/FileHandler.class.php @@ -40,6 +40,7 @@ if(@!$fp = fopen($file_name,$mode)) return false; fwrite($fp, $buff); fclose($fp); + @chmod($file_name, 0644); } /** diff --git a/classes/optimizer/Optimizer.class.php b/classes/optimizer/Optimizer.class.php index bd3209d44..2a1e5b407 100644 --- a/classes/optimizer/Optimizer.class.php +++ b/classes/optimizer/Optimizer.class.php @@ -30,7 +30,7 @@ for($i=0;$i<$file_count;$i++) { $file = trim($source_files[$i]); if(!$file) continue; - if(eregi("^http:\/\/",$file)) $files[] = $file; + if(eregi("^http:\/\/",$file) || $file == './common/css/button.css') $files[] = $file; else $targets[] = $file; } @@ -86,9 +86,10 @@ // css 일경우 background:url() 변경 if($type == "css") $str = $this->replaceCssPath($file, $str); - $content_buff .= $str."\n"; + $content_buff .= $str."\r\n"; } if(Context::isGzEnabled()) $content_buff = ob_gzhandler($content_buff, 5); + $content_file = eregi_replace("\.php$","",$filename); $content_filename = str_replace($this->cache_path, '', $content_file); @@ -110,11 +111,7 @@ $header_buff = <<tmp_css_path = Context::getRequestUri().ereg_replace("^\.\/","",dirname($file))."/"; $str = preg_replace_callback('!url\(("|\'){0,1}([^\)]+)("|\'){0,1}\)!is', array($this, '_replaceCssPath'), $str); + + $str = preg_replace('!\/([^\/]*)\/\.\.\/!is','/', $str); + return $str; } function _replaceCssPath($matches) { if(eregi("^http",$matches[2])) return $matches[0]; + if(eregi("^\.\/common\/",$matches[2])) return $matches[0]; return sprintf('url(%s)', $this->tmp_css_path.$matches[2]); }