From 2c5c1fe8f52df0d559d5980bdb115f11f4642460 Mon Sep 17 00:00:00 2001 From: devjin Date: Thu, 19 Jul 2012 11:57:56 +0000 Subject: [PATCH] issue 1886 return origin code when src value include variable. git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.3.1@10918 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/template/TemplateHandler.class.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index 27d47302c..3e1bb21c0 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -199,7 +199,11 @@ class TemplateHandler { $buff = preg_replace('@@is','',$buff); // form auto generation - $buff = preg_replace_callback('/(|[^<>]+)*?>)(.*?)(<\/form>)/is', array($this, '_compileFormAuthGeneration'), $buff); + $temp = preg_replace_callback('/(|[^<>]+)*?>)(.*?)(<\/form>)/is', array($this, '_compileFormAuthGeneration'), $buff); + if($temp) + { + $buff = $temp; + } // prevent from calling directly before writing into file $buff = ''.$buff; @@ -319,6 +323,12 @@ class TemplateHandler { **/ function _replacePath($match) { + //return origin code when src value include variable. + if(preg_match('/^[\'|"]\s*\.\s*\$/', $match[1])) + { + return $match[0]; + } + $src = preg_replace('@^(\./)+@', '', trim($match[1])); $src = $this->web_path.$src;