You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got some wierd "Smarty: Unable to load template file" errors, and I followed them to the _realpath function in the Smarty class.
I tested the function by mocking getcwd to always return /0/1/2/3/4/5/6/7/8/9, set the DS constant to / and then tested _realpath with $realpath always being set to true.
Hi,
I got some wierd "Smarty: Unable to load template file" errors, and I followed them to the
_realpath
function in theSmarty
class.I tested the function by mocking
getcwd
to always return/0/1/2/3/4/5/6/7/8/9
, set theDS
constant to/
and then tested_realpath
with$realpath
always being set totrue
.Path:
folder
Realpath:
/0/1/2/3/4/5/6/7/8/9/folder
Path:
../folder
Realpath:
/0/1/2/3/4/5/6/7/8/folder
Path:
../../folder
Realpath:
/0/1/2/3/4/5/6/7/folder
Path:
../../../folder
Realpath:
/0/1/2/3/4/5/6/folder
Wierd stuff occurs from here on:
Path:
../../../../folder
Realpath:
/0/1/2/3/4/5/6/7/folder
Should be:
/0/1/2/3/4/5/folder
Path:
../../../../../folder
Realpath:
/0/1/2/3/4/5/6/folder
Should be:
/0/1/2/3/4/folder
Path:
../../../../../../folder
Realpath:
/0/1/2/3/4/5/folder
Should be:
/0/1/2/3/folder
Path:
../../../../../../../folder
Realpath:
/0/1/2/3/4/5/6/folder
Should be:
/0/1/2/folder
Path:
../../../../../../../../folder
Realpath:
/0/1/2/3/4/5/folder
Should be:
/0/1/folder
Path:
../../../../../../../../../folder
Realpath:
/0/1/2/3/4/5/6/folder
Should be:
/0/folder
Can this be fixed, or is there any workaround?
The text was updated successfully, but these errors were encountered: