From 9f7c1210cfc7d78af31023daacd4f56874dab7e2 Mon Sep 17 00:00:00 2001 From: haneul Date: Tue, 18 May 2010 07:57:07 +0000 Subject: [PATCH] #18865278 : fixed path problem in outpage with optimizer git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7468 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/optimizer/Optimizer.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/classes/optimizer/Optimizer.class.php b/classes/optimizer/Optimizer.class.php index 09e070bef..6b91727f0 100644 --- a/classes/optimizer/Optimizer.class.php +++ b/classes/optimizer/Optimizer.class.php @@ -48,7 +48,11 @@ $files = array(); $hash = ""; foreach($source_files as $key => $file) { - if(!$file || !$file['file'] || !file_exists($file['file'])) continue; + 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{ @@ -77,14 +81,12 @@ FileHandler::writeFile($list_file, $str); } } - array_unshift($files, array('file' => sprintf($this->script_file, $list_file_hash, $type) , 'media' => 'all')); $files = $this->_getOptimizedRemoved($files); if(!count($files)) return $files; $url_info = parse_url(Context::getRequestUri()); $abpath = $url_info['path']; - foreach($files as $key => $val) { $file = $val['file'];