Compare commits

..

3 Commits

5 changed files with 15 additions and 11 deletions
+8 -1
View File
@@ -1,4 +1,11 @@
===== 3.1.25===== (15.06.2015)
===== 3.1.26===== (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
17.06.2015
- bugfix calling a plugin with nocache option but no other attributes like {foo nocache} caused call to undefined function https://github.com/smarty-php/smarty/issues/55
===== 3.1.25===== (15.06.2015)
15.06.2015
- optimization of smarty_cachereource_keyvaluestore.php code
+1 -1
View File
@@ -387,7 +387,7 @@ smartytag(res)::= SIMPLETAG(t). {
res = $this->compiler->compileTag('private_print_expression',array(),array('value'=>$tag));
} else {
if (preg_match('/^(.*)(\s+nocache)$/', $tag, $match)) {
res = $this->compiler->compileTag($match[1],array('nocache'));
res = $this->compiler->compileTag($match[1],array("'nocache'"));
} else {
res = $this->compiler->compileTag($tag,array());
}
+2 -2
View File
@@ -27,7 +27,7 @@
* @author Uwe Tews
* @author Rodney Rehm
* @package Smarty
* @version 3.1.25
* @version 3.1.26
*/
/**
@@ -111,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.25';
const SMARTY_VERSION = '3.1.26';
/**
* define variable scopes
@@ -17,9 +17,6 @@
*/
class Smarty_Internal_Resource_File extends Smarty_Resource
{
private $dsMap = array('/' => array(array('\\', '/./'), '/.'), '\\' => array(array('/', '\\.\\'), '\\.'));
/**
* build template filepath by traversing the template_dir array
*
@@ -127,9 +124,9 @@ class Smarty_Internal_Resource_File extends Smarty_Resource
if ($path[0] == '.') {
$path = getcwd() . DS . $path;
}
$path = str_replace($this->dsMap[DS][0], DS, $path);
while (strrpos($path, $this->dsMap[DS][1]) !== false) {
$path = preg_replace('#([\\\/][.][\\\/])|([\\\/][^\\\/]+[\\\/][.][.][\\\/])#', DS, $path);
$path = preg_replace('#[\\\/]+([.][\\\/]+)*([.](?![.]))?#', DS, $path);
while (strrpos($path, DS . '.') !== false) {
$path = preg_replace('#([\\\/]([^\\\/]+[\\\/]){2}([.][.][\\\/]){2})|([\\\/][^\\\/]+[\\\/][.][.][\\\/]?)#', DS, $path);
}
return $path;
}
@@ -1375,7 +1375,7 @@ class Smarty_Internal_Templateparser
$this->_retvalue = $this->compiler->compileTag('private_print_expression', array(), array('value' => $tag));
} else {
if (preg_match('/^(.*)(\s+nocache)$/', $tag, $match)) {
$this->_retvalue = $this->compiler->compileTag($match[1], array('nocache'));
$this->_retvalue = $this->compiler->compileTag($match[1], array("'nocache'"));
} else {
$this->_retvalue = $this->compiler->compileTag($tag, array());
}