issue 1981, fixed a bug on replace parent directory mark ../

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.3.1@10904 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2012-07-17 08:53:50 +00:00
parent beb9a9f89e
commit 33d2137574

View file

@ -327,7 +327,7 @@ class TemplateHandler {
// for backward compatibility
$src = preg_replace('@/((?:[\w-]+/)+)\1@', '/\1', $src);
while(($tmp=preg_replace('@[^/]+/\.\./@', '', $src))!==$src) $src = $tmp;
while(($tmp=preg_replace('@[^/]+/\.\./@', '', $src, 1))!==$src) $src = $tmp;
return substr($match[0],0,-strlen($match[1])-6)."src=\"{$src}\"";
}