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;