diff --git a/classes/optimizer/Optimizer.class.php b/classes/optimizer/Optimizer.class.php index 6b91727f0..cffe5f9e7 100644 --- a/classes/optimizer/Optimizer.class.php +++ b/classes/optimizer/Optimizer.class.php @@ -48,18 +48,22 @@ $files = array(); $hash = ""; foreach($source_files as $key => $file) { - if($file['file'][0] == '/') - { - if(!file_exists($_SERVER['DOCUMENT_ROOT'].$file['file'])) continue; - } - else if(!$file || !$file['file'] || !file_exists($file['file'])) continue; - $file['file'] = $source_files[$key]['file'] = str_replace("\\","/",$file['file']); - if(empty($file['optimized']) || preg_match('/^https?:\/\//i', $file['file']) ) $files[] = $file; - else{ + if($file['file'][0] == '/'){ + if(!file_exists($file['file'])){ + if(file_exists($_SERVER['DOCUMENT_ROOT'] . $file['file'])){ + $source_files[$key] = $file['file'] = $_SERVER['DOCUMENT_ROOT'].$file['file']; + }else{ + continue; + } + } + } else if(!$file || !$file['file'] || !file_exists($file['file'])) continue; + $file['file'] = $source_files[$key]['file'] = str_replace("\\","/",$file['file']); + if(empty($file['optimized']) || preg_match('/^https?:\/\//i', $file['file']) ) $files[] = $file; + else{ $targets[] = $file; $hash .= $file['file']; } - } + } if(!count($targets)) return $this->_getOptimizedRemoved($files); $list_file_hash = md5($hash); @@ -71,7 +75,7 @@ $oCacheHandler->put($list_file_hash, $buff); } }else{ - $list_file = FileHandler::getRealPath($this->cache_path . $list_file_hash); + $list_file = FileHandler::getRealPath($this->cache_path . $list_file_hash . '.info.php'); if(!file_exists($list_file)){ $str = ' sprintf($this->script_file, $list_file_hash, $type) , 'media' => 'all')); $files = $this->_getOptimizedRemoved($files); if(!count($files)) return $files; diff --git a/common/css/default.css b/common/css/default.css index d4f85fc4b..dba8b421f 100644 --- a/common/css/default.css +++ b/common/css/default.css @@ -1,5 +1,3 @@ -@charset "utf-8"; - /* default.css - Type Selector Definition */ body { margin:0;padding:0; font-size:.75em;} diff --git a/common/css/popup.css b/common/css/popup.css index 109a830e3..6b558e507 100644 --- a/common/css/popup.css +++ b/common/css/popup.css @@ -1,4 +1,2 @@ -@charset "utf-8"; - body { overflow:hidden; } -table.colTable { margin:0; } \ No newline at end of file +table.colTable { margin:0; } diff --git a/common/script.php b/common/script.php index f5c9b865e..599c2115c 100644 --- a/common/script.php +++ b/common/script.php @@ -33,7 +33,7 @@ $XE_WEB_PATH = substr($XE_PATH,strlen($_SERVER['DOCUMENT_ROOT'])); if(substr($XE_WEB_PATH,-1) != "/") $XE_WEB_PATH .= "/"; $cache_path = $XE_PATH . 'files/cache/optimized/'; $type = $_GET['t']; -$list_file = $cache_path . $_GET['l']; +$list_file = $cache_path . $_GET['l'] .'.info.php'; function getRealPath($file){ @@ -111,6 +111,7 @@ function printFileList($list){ for($i=0,$c=count($list);$i<$c;$i++){ $file = getRealPath($list[$i]); if(file_exists($file)){ + $output .= '/* file:' . $file . " */\n"; $output .= file_get_contents($file); $output .= "\n"; } @@ -207,6 +208,8 @@ function _replaceCssPath($matches) { } function convertEncodingStr($str) { + if(!$str) return ''; + $charset_list = array( 'UTF-8', 'EUC-KR', 'CP949', 'ISO8859-1', 'EUC-JP', 'SHIFT_JIS', 'CP932', 'EUC-CN', 'HZ', 'GBK', 'GB18030', 'EUC-TW', 'BIG5', 'CP950', 'BIG5-HKSCS', @@ -218,13 +221,11 @@ function convertEncodingStr($str) { 'CP1257', 'CP850', 'CP866', ); - for($i=0;$i - + \ No newline at end of file diff --git a/common/tpl/popup_layout.html b/common/tpl/popup_layout.html index 1131076fb..9131fc9fb 100644 --- a/common/tpl/popup_layout.html +++ b/common/tpl/popup_layout.html @@ -9,4 +9,4 @@ \ No newline at end of file + diff --git a/common/tpl/redirect.html b/common/tpl/redirect.html index 53f59e4f5..087cb18a8 100644 --- a/common/tpl/redirect.html +++ b/common/tpl/redirect.html @@ -23,4 +23,4 @@ } - + \ No newline at end of file diff --git a/common/tpl/refresh.html b/common/tpl/refresh.html index 4ac78ff14..8dd70d228 100644 --- a/common/tpl/refresh.html +++ b/common/tpl/refresh.html @@ -1,3 +1,3 @@ + \ No newline at end of file