From 5f22b33b43e82e55fe75a8be3c4801ffc7ff1905 Mon Sep 17 00:00:00 2001 From: taggon Date: Tue, 5 Apr 2011 05:44:15 +0000 Subject: [PATCH] merging with r8261 git-svn-id: http://xe-core.googlecode.com/svn/trunk@8262 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/display/HTMLDisplayHandler.php | 7 ++++--- classes/template/TemplateHandler.class.php | 6 ++++++ modules/widget/widget.controller.php | 5 ++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/classes/display/HTMLDisplayHandler.php b/classes/display/HTMLDisplayHandler.php index 4e784502b..577f98163 100644 --- a/classes/display/HTMLDisplayHandler.php +++ b/classes/display/HTMLDisplayHandler.php @@ -70,7 +70,7 @@ class HTMLDisplayHandler { $output = preg_replace_callback('!!is', array($this,'_moveStyleToHeader'), $output); // 메타 파일 변경 (캐싱기능등으로 인해 위젯등에서 태그를 content에 넣는 경우가 있음 - $output = preg_replace_callback('//is', array($this,'_transMeta'), $output); + $output = preg_replace_callback('//is', array($this,'_transMeta'), $output); // rewrite module 사용시 생기는 상대경로에 대한 처리를 함 if(Context::isAllowRewrite()) { @@ -128,8 +128,9 @@ class HTMLDisplayHandler { * @param[in] $oModule the module object **/ function _transMeta($matches) { - if(substr($matches[1],'-4')=='.css') Context::addCSSFile($matches[1]); - elseif(substr($matches[1],'-3')=='.js') Context::addJSFile($matches[1]); + if($matches[1]) return ''; + if(substr($matches[2],'-4')=='.css') Context::addCSSFile($matches[2]); + elseif(substr($matches[2],'-3')=='.js') Context::addJSFile($matches[2]); } function _loadJSCSS() diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index f8059c80b..1b9c1bd1d 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -518,6 +518,7 @@ if($type == 'unload') { $output = ''; } else { + $meta_file = $source_filename; $output = ''; } break; @@ -526,12 +527,14 @@ if($type == 'unload') { $output = ''; } else { + $meta_file = $source_filename; $output = ''; } break; } } + if($meta_file) $output = ''.$output; return $output; } @@ -794,6 +797,7 @@ if(preg_match('/^(http|\/)/i',$source_filename)) { $output = sprintf('', $source_filename, 'false', $media, $targetie, $index); } else { + $meta_file = $base_path.$filename; $output = sprintf('', $base_path, $filename, $optimized, $media, $targetie, $index); } break; @@ -802,12 +806,14 @@ if(preg_match('/^(http|\/)/i',$source_filename)) { $output = sprintf('', $source_filename, 'false', $targetie, $index, $type); } else { + $meta_file = $base_path.$filename; $output = sprintf('', $base_path, $filename, $optimized, $targetie, $index, $type); } break; } } + if($meta_file) $output = ''.$output; return $output; } diff --git a/modules/widget/widget.controller.php b/modules/widget/widget.controller.php index 25f876082..ba55fd883 100644 --- a/modules/widget/widget.controller.php +++ b/modules/widget/widget.controller.php @@ -370,7 +370,10 @@ // 수정 시간을 비교해서 캐싱중이어야 하거나 widget.controller.php 파일보다 나중에 만들어 졌다면 캐시값을 return if($filemtime + $widget_cache * 60 > time() && $filemtime > filemtime(_XE_PATH_.'modules/widget/widget.controller.php')) { - return FileHandler::readFile($cache_file); + $cache_body = FileHandler::readFile($cache_file); + $cache_body = preg_replace('@<\!--#Meta@:', '