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
This commit is contained in:
devjin 2012-07-19 11:57:56 +00:00
parent 53175d7c1e
commit 2c5c1fe8f5

View file

@ -199,7 +199,11 @@ class TemplateHandler {
$buff = preg_replace('@</?block\s*>@is','',$buff);
// form auto generation
$buff = preg_replace_callback('/(<form(?:<\?php.+?\?>|[^<>]+)*?>)(.*?)(<\/form>)/is', array($this, '_compileFormAuthGeneration'), $buff);
$temp = preg_replace_callback('/(<form(?:<\?php.+?\?>|[^<>]+)*?>)(.*?)(<\/form>)/is', array($this, '_compileFormAuthGeneration'), $buff);
if($temp)
{
$buff = $temp;
}
// prevent from calling directly before writing into file
$buff = '<?php if(!defined("__XE__"))exit;?>'.$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;