diff --git a/change_log.txt b/change_log.txt index 047435ad..32b3d217 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,6 +1,8 @@ 30/04/2010 - bugfix when comparing timestamps in sysplugins/smarty_internal_config.php - work around of a substr_compare bug in older PHP5 versions +- bugfix on template inheritance for tag names starting with "block" +- bugfix on {function} tag with name attribute in doublequoted strings ===== RC1 ===== diff --git a/libs/sysplugins/smarty_internal_compile_extends.php b/libs/sysplugins/smarty_internal_compile_extends.php index 875e17b7..3f5997a4 100644 --- a/libs/sysplugins/smarty_internal_compile_extends.php +++ b/libs/sysplugins/smarty_internal_compile_extends.php @@ -37,11 +37,11 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase { // save file dependency $compiler->template->properties['file_dependency'][sha1($_template->getTemplateFilepath())] = array($_template->getTemplateFilepath(), $_template->getTemplateTimestamp()); $_content = $compiler->template->template_source; - if (preg_match_all("!({$this->_ldl}block(.+?){$this->_rdl})!", $_content, $s) != + if (preg_match_all("!({$this->_ldl}block\s(.+?){$this->_rdl})!", $_content, $s) != preg_match_all("!({$this->_ldl}/block(.*?){$this->_rdl})!", $_content, $c)) { $this->compiler->trigger_template_error('unmatched {block} {/block} pairs'); } - preg_match_all("!{$this->_ldl}block(.+?){$this->_rdl}|{$this->_ldl}/block(.*?){$this->_rdl}!", $_content, $_result, PREG_OFFSET_CAPTURE); + preg_match_all("!{$this->_ldl}block\s(.+?){$this->_rdl}|{$this->_ldl}/block(.*?){$this->_rdl}!", $_content, $_result, PREG_OFFSET_CAPTURE); $_result_count = count($_result[0]); $_start = 0; while ($_start < $_result_count) { diff --git a/libs/sysplugins/smarty_internal_compile_function.php b/libs/sysplugins/smarty_internal_compile_function.php index 86363b2b..61090f16 100644 --- a/libs/sysplugins/smarty_internal_compile_function.php +++ b/libs/sysplugins/smarty_internal_compile_function.php @@ -63,7 +63,7 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase $this->compiler->has_code = false; $_attr = $this->_get_attributes($args); $saved_data = $this->_close_tag(array('function')); - $_name = trim($saved_data[0]['name'], "'"); + $_name = trim($saved_data[0]['name'], "'\""); // build plugin include code $plugins_string = ''; if (!empty($compiler->template->required_plugins['compiled'])) { diff --git a/libs/sysplugins/smarty_internal_resource_extends.php b/libs/sysplugins/smarty_internal_resource_extends.php index c4f588a6..44490758 100644 --- a/libs/sysplugins/smarty_internal_resource_extends.php +++ b/libs/sysplugins/smarty_internal_resource_extends.php @@ -98,11 +98,11 @@ class Smarty_Internal_Resource_Extends { $_template->template_filepath = $_filepath; $_content = file_get_contents($_filepath); if ($_filepath != $_files[count($_files)-1]) { - if (preg_match_all("!({$this->_ldl}block(.+?){$this->_rdl})!", $_content, $_open) != + if (preg_match_all("!({$this->_ldl}block\s(.+?){$this->_rdl})!", $_content, $_open) != preg_match_all("!({$this->_ldl}/block(.*?){$this->_rdl})!", $_content, $_close)) { $this->smarty->trigger_error("unmatched {block} {/block} pairs in file '$_filepath'"); } - preg_match_all("!{$this->_ldl}block(.+?){$this->_rdl}|{$this->_ldl}/block(.*?){$this->_rdl}!", $_content, $_result, PREG_OFFSET_CAPTURE); + preg_match_all("!{$this->_ldl}block\s(.+?){$this->_rdl}|{$this->_ldl}/block(.*?){$this->_rdl}!", $_content, $_result, PREG_OFFSET_CAPTURE); $_result_count = count($_result[0]); $_start = 0; while ($_start < $_result_count) {