From 37719ce85884dd6dc8883d3a7d076d5fc6027c0c Mon Sep 17 00:00:00 2001 From: "uwe.tews@googlemail.com" Date: Fri, 21 Oct 2011 12:08:35 +0000 Subject: [PATCH] - bugfix apostrophe in plugins_dir path name failed (forum topic 20199) --- change_log.txt | 3 +++ libs/sysplugins/smarty_internal_template.php | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/change_log.txt b/change_log.txt index aad65444..472a70d6 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +21.10.2011 +- bugfix apostrope in plugins_dir path name failed (forum topic 20199) + 20.10.2011 - @silenced unlink() in Smarty_Internal_Write_File since debuggers go haywire without it. - bugfix Smarty::clearCompiledTemplate() threw an Exception if $cache_id was not present in $compile_dir when $use_sub_dirs = true. diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index cc32e8ab..559ef307 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -334,7 +334,8 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { $plugins_string = 'required_plugins['compiled'] as $tmp) { foreach ($tmp as $data) { - $plugins_string .= "if (!is_callable('{$data['function']}')) include '{$data['file']}';\n"; + $file = addslashes($data['file']); + $plugins_string .= "if (!is_callable('{$data['function']}')) include '{$file}';\n"; } } $plugins_string .= '?>'; @@ -344,7 +345,8 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { $plugins_string .= "properties['nocache_hash']}%%*/smarty; "; foreach ($this->required_plugins['nocache'] as $tmp) { foreach ($tmp as $data) { - $plugins_string .= "if (!is_callable(\'{$data['function']}\')) include \'{$data['file']}\';\n"; + $file = addslashes($data['file']); + $plugins_string .= addslashes("if (!is_callable('{$data['function']}')) include '{$file}';\n"); } } $plugins_string .= "?>/*/%%SmartyNocache:{$this->properties['nocache_hash']}%%*/';?>\n"; @@ -564,7 +566,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { { throw new SmartyException("Not matching {capture} open/close in \"{$this->template_resource}\""); } - + /** * Empty cache for this template * @@ -576,7 +578,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { Smarty_CacheResource::invalidLoadedCache($this->smarty); return $this->cached->handler->clear($this->smarty, $this->template_name, $this->cache_id, $this->compile_id, $exp_time); } - + /** * set Smarty property in template context *