Smarty upgrade 3.1.27

This commit is contained in:
Ian 2015-06-18 13:20:50 +02:00
parent a148f7b227
commit a7d4e0111d
4 changed files with 18 additions and 10 deletions

View File

@ -1,4 +1,15 @@
 ===== 3.1.25===== (15.06.2015)
 ===== 3.1.27===== (18.06.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
- 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

View File

@ -27,7 +27,7 @@
* @author Uwe Tews
* @author Rodney Rehm
* @package Smarty
* @version 3.1.25
* @version 3.1.27
*/
/**
@ -111,7 +111,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.25';
const SMARTY_VERSION = '3.1.27';
/**
* define variable scopes

View File

@ -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;
}

View File

@ -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());
}