diff options
Diffstat (limited to 'library/Smarty/libs/Smarty.class.php')
-rw-r--r-- | library/Smarty/libs/Smarty.class.php | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/library/Smarty/libs/Smarty.class.php b/library/Smarty/libs/Smarty.class.php index 17457131c..a029f942e 100644 --- a/library/Smarty/libs/Smarty.class.php +++ b/library/Smarty/libs/Smarty.class.php @@ -27,7 +27,7 @@ * @author Uwe Tews * @author Rodney Rehm * @package Smarty - * @version 3.1.28 + * @version 3.1.29 */ /** @@ -118,7 +118,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.28'; + const SMARTY_VERSION = '3.1.29'; /** * define variable scopes @@ -677,15 +677,20 @@ class Smarty extends Smarty_Internal_TemplateBase /** * removed properties * - * @var array + * @var string[] */ private static $obsoleteProperties = array('resource_caching', 'template_resource_caching', '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',); + /** + * List of private properties which will call getter/setter ona direct access + * + * @var array + */ + private static $accessMap = array('template_dir' => 'TemplateDir', 'config_dir' => 'ConfigDir', + 'plugins_dir' => 'PluginsDir', 'compile_dir' => 'CompileDir', + 'cache_dir' => 'CacheDir',); /**#@-*/ @@ -1173,7 +1178,7 @@ class Smarty extends Smarty_Internal_TemplateBase $path = str_replace($nds, DS, $path); } - if ($realpath === true && $path[0] !== '/' && $path[1] !== ':') { + if ($realpath === true && (($path[0] !== '/' && DS == '/') || ($path[1] !== ':' && DS != '/'))) { $path = getcwd() . DS . $path; } while ((strpos($path, '.' . DS) !== false) || (strpos($path, DS . DS) !== false)) { @@ -1344,7 +1349,8 @@ class Smarty extends Smarty_Internal_TemplateBase { if (isset(self::$accessMap[$name])) { - return $this->{self::$accessMap[$name]}(); + $method = 'get' . self::$accessMap[$name]; + return $this->{$method}(); } elseif (in_array($name, self::$obsoleteProperties)) { return null; } else { @@ -1363,7 +1369,8 @@ class Smarty extends Smarty_Internal_TemplateBase public function __set($name, $value) { if (isset(self::$accessMap[$name])) { - $this->{self::$accessMap[$name]}($value); + $method = 'set' . self::$accessMap[$name]; + $this->{$method}($value); } elseif (in_array($name, self::$obsoleteProperties)) { return; } else { |