-
Notifications
You must be signed in to change notification settings - Fork 714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sysplugins/smarty_internal_resource_file.php : buildFilepath() relative path bug #50
Comments
Which Smarty version do you run? |
smarty version : 3.1.24 {{include file="a.tpl"}} <= OK {{include file="./a.tpl"}} <= Error Unable to load template file './a.tpl' in 'index.tpl' |
uwetews
added a commit
that referenced
this issue
Jun 14, 2015
… did contain /../ #50 - optimization rework of path normalization
The fix is now in dev-master Path normalization has been completely reworked |
think-mcunanan
pushed a commit
to think-mcunanan/smarty
that referenced
this issue
Mar 22, 2023
Merge release-2.0.6 release branch into master
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
case : $_template->parent->source->filepath is "/a/b/c/../../d/e/abc.tpl"
$path = dirname($_template->parent->source->filepath);
...
$path = str_replace(array('', './'), array('/', ''), $path);
$path
result : "/a/b/c/..d/e/" <= wrong value
expect : "/a/b/c/../../d/e/"
modify
$path = dirname($_template->parent->source->filepath);
=>
$path = realpath(dirname($_template->parent->source->filepath));
$path
result : "/a/d/e/" <= right value
The text was updated successfully, but these errors were encountered: