From f602198b60a7f730ed421360dcc3543430ffb24c Mon Sep 17 00:00:00 2001 From: ngleader Date: Wed, 22 Dec 2010 10:39:21 +0000 Subject: [PATCH] =?UTF-8?q?#19347873=20=EB=AC=B8=EB=B2=95=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20xml=20filter=20=EC=B6=94=EA=B0=80=EC=8B=9C=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=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@7989 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/template/TemplateHandler.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index 3926cf46a..683f9679f 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -478,15 +478,15 @@ // otherwise try to load xml, css, js file } else { - if(preg_match('/^(http|https)/i',$target)) $source_filename = $target; - else if(substr($target,0,1)!='/') $source_filename = $base_path.$target; + if(substr($target,0,1)!='/') $source_filename = $base_path.$target; else $source_filename = $target; + $source_filename = str_replace(array('/./','//'),'/',$source_filename); // get filename and path $tmp_arr = explode("/",$source_filename); $filename = array_pop($tmp_arr); - $base_path = implode("/",$tmp_arr)."/"; + //$base_path = implode("/",$tmp_arr)."/"; // get the ext $tmp_arr = explode(".",$filename); @@ -496,6 +496,7 @@ switch($ext) { // xml js filter case 'xml' : + if(preg_match('/^(http|https)/i',$source_filename)) return; // create an instance of XmlJSFilter class, then create js and handle Context::addJsFile $output = sprintf( '%s', "\n", "\n", - $this->path, + dirname($base_path . $attrs['target']).'/', $filename, "\n", "\n", @@ -514,18 +515,17 @@ break; // css file case 'css' : - if(!preg_match('/^(http|https|\/)/i',$source_filename)) $source_filename = $this->path.$filename; if($type == 'unload') $output = ''; else $output = ''; break; // js file case 'js' : - if(!preg_match('/^(http|https|\/)/i',$source_filename)) $source_filename = $this->path.$filename; if($type == 'unload') $output = ''; else $output = ''; break; } } + return $output; }