- bugfix on template inheritance for tag names starting with "block"

- bugfix on {function} tag with name attribute in doublequoted strings
This commit is contained in:
Uwe.Tews
2010-04-30 18:11:34 +00:00
parent ace9d4fe5e
commit 0920b383c6
4 changed files with 7 additions and 5 deletions

View File

@@ -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 =====

View File

@@ -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) {

View File

@@ -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'])) {

View File

@@ -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) {