diff --git a/change_log.txt b/change_log.txt index cab2f7e6..e3c52f20 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,5 +1,6 @@ 01/06/2009 - fixed typo in smarty_internal_resource_registered +- bugfix for custom delimiter at extends resource and {extends} tag 01/05/2009 - bugfix sha1() calculations at extends resource and some general improvments on sha1() handling diff --git a/libs/sysplugins/smarty_internal_compile_extends.php b/libs/sysplugins/smarty_internal_compile_extends.php index 4b1ed1d0..cbe5258f 100644 --- a/libs/sysplugins/smarty_internal_compile_extends.php +++ b/libs/sysplugins/smarty_internal_compile_extends.php @@ -53,10 +53,10 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase { protected function saveBlockData($block_content, $block_tag, $template) { - if (0 == preg_match('/(.?)(name=)([^ ]*)/', $block_tag, $_match)) { + if (0 == preg_match("/(.?)(name=)(.*?)(?=(\s|{$this->smarty->right_delimiter}))/", $block_tag, $_match)) { $this->compiler->trigger_template_error("\"" . $block_tag . "\" missing name attribute"); } else { - $_name = trim($_match[3], "\"'}"); + $_name = trim($_match[3], "\"'"); if (isset($this->smarty->block_data[$_name])) { if (strpos($this->smarty->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) { $this->smarty->block_data[$_name]['source'] = diff --git a/libs/sysplugins/smarty_internal_resource_extends.php b/libs/sysplugins/smarty_internal_resource_extends.php index 69e93b6b..427254a9 100644 --- a/libs/sysplugins/smarty_internal_resource_extends.php +++ b/libs/sysplugins/smarty_internal_resource_extends.php @@ -115,10 +115,10 @@ class Smarty_Internal_Resource_Extends { } protected function saveBlockData($block_content, $block_tag, $_filepath) { - if (0 == preg_match('/(.?)(name=)([^ ]*)/', $block_tag, $_match)) { + if (0 == preg_match("/(.?)(name=)(.*?)(?=(\s|{$this->smarty->right_delimiter}))/", $block_tag, $_match)) { $this->smarty->trigger_error("\"" . $block_tag . "\" missing name attribute"); } else { - $_name = trim($_match[3], "\"'}"); + $_name = trim($_match[3], "\"'"); if (isset($this->smarty->block_data[$_name])) { if (strpos($this->smarty->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) { $this->smarty->block_data[$_name]['source'] =