mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
- bugfix another update on file path normalization failed on path containing something like "/.foo/" https://github.com/smarty-php/smarty/issues/56
This commit is contained in:
@@ -1,4 +1,8 @@
|
|||||||
===== 3.1.26===== (18.06.2015)
|
===== 3.1.27-dev===== (xx.xx.2015)
|
||||||
|
18.06.2015
|
||||||
|
- bugfix another update on file path normalization failed on path containing something like "/.foo/" https://github.com/smarty-php/smarty/issues/56
|
||||||
|
|
||||||
|
===== 3.1.26===== (18.06.2015)
|
||||||
18.06.2015
|
18.06.2015
|
||||||
- bugfix file path normalization failed on path containing something like "/.foo/" https://github.com/smarty-php/smarty/issues/56
|
- bugfix file path normalization failed on path containing something like "/.foo/" https://github.com/smarty-php/smarty/issues/56
|
||||||
|
|
||||||
|
@@ -124,9 +124,9 @@ class Smarty_Internal_Resource_File extends Smarty_Resource
|
|||||||
if ($path[0] == '.') {
|
if ($path[0] == '.') {
|
||||||
$path = getcwd() . DS . $path;
|
$path = getcwd() . DS . $path;
|
||||||
}
|
}
|
||||||
$path = preg_replace('#[\\\/]+([.][\\\/]+)*([.](?![.]))?#', DS, $path);
|
$path = preg_replace('#[\\\/]+([.][\\\/]+)*#', DS, $path);
|
||||||
while (strrpos($path, DS . '.') !== false) {
|
while (strrpos($path, '.' . DS) !== false) {
|
||||||
$path = preg_replace('#([\\\/]([^\\\/]+[\\\/]){2}([.][.][\\\/]){2})|([\\\/][^\\\/]+[\\\/][.][.][\\\/]?)#', DS, $path);
|
$path = preg_replace('#([\\\/]([^\\\/]+[\\\/]){2}([.][.][\\\/]){2})|([\\\/][^\\\/]+[\\\/][.][.][\\\/])#', DS, $path);
|
||||||
}
|
}
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user