diff --git a/change_log.txt b/change_log.txt index cb7ec49f..84c493f1 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,6 +1,7 @@  ===== 3.1.29-dev ===== (xx.xx.2015) 16.12.2015 - bugfix {foreach} did fail if from atrribute is a Generator class https://github.com/smarty-php/smarty/issues/128 + - bugfix direct access $smarty->template_dir = 'foo'; should call Smarty::setTemplateDir() https://github.com/smarty-php/smarty/issues/121 15.12.2015 - bugfix {$smarty.cookies.foo} did return the $_COOKIE array not the 'foo' value https://github.com/smarty-php/smarty/issues/122 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 628e22d4..d95ef958 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -118,7 +118,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.29-dev/6'; + const SMARTY_VERSION = '3.1.29-dev/7'; /** * define variable scopes @@ -683,9 +683,13 @@ class Smarty extends Smarty_Internal_TemplateBase 'direct_access_security', '_dir_perms', '_file_perms', 'plugin_search_order', 'inheritance_merge_compiled_includes'); - private static $accessMap = array('template_dir' => 'getTemplateDir', 'config_dir' => 'getConfigDir', - 'plugins_dir' => 'getPluginsDir', 'compile_dir' => 'getCompileDir', - 'cache_dir' => 'getCacheDir',); + private static $accessMapGet = array('template_dir' => 'getTemplateDir', 'config_dir' => 'getConfigDir', + 'plugins_dir' => 'getPluginsDir', 'compile_dir' => 'getCompileDir', + 'cache_dir' => 'getCacheDir',); + + private static $accessMapSet = array('template_dir' => 'setTemplateDir', 'config_dir' => 'setConfigDir', + 'plugins_dir' => 'setPluginsDir', 'compile_dir' => 'setCompileDir', + 'cache_dir' => 'setCacheDir',); /**#@-*/ @@ -1343,8 +1347,8 @@ class Smarty extends Smarty_Internal_TemplateBase public function __get($name) { - if (isset(self::$accessMap[$name])) { - return $this->{self::$accessMap[$name]}(); + if (isset(self::$accessMapGet[$name])) { + return $this->{self::$accessMapGet[$name]}(); } elseif (in_array($name, self::$obsoleteProperties)) { return null; } else { @@ -1362,8 +1366,8 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function __set($name, $value) { - if (isset(self::$accessMap[$name])) { - $this->{self::$accessMap[$name]}($value); + if (isset(self::$accessMapSet[$name])) { + $this->{self::$accessMapSet[$name]}($value); } elseif (in_array($name, self::$obsoleteProperties)) { return; } else {