mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-07 11:54:26 +02:00
- 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:
@@ -1,6 +1,8 @@
|
|||||||
30/04/2010
|
30/04/2010
|
||||||
- bugfix when comparing timestamps in sysplugins/smarty_internal_config.php
|
- bugfix when comparing timestamps in sysplugins/smarty_internal_config.php
|
||||||
- work around of a substr_compare bug in older PHP5 versions
|
- 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 =====
|
===== RC1 =====
|
||||||
|
|
||||||
|
@@ -37,11 +37,11 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase {
|
|||||||
// save file dependency
|
// save file dependency
|
||||||
$compiler->template->properties['file_dependency'][sha1($_template->getTemplateFilepath())] = array($_template->getTemplateFilepath(), $_template->getTemplateTimestamp());
|
$compiler->template->properties['file_dependency'][sha1($_template->getTemplateFilepath())] = array($_template->getTemplateFilepath(), $_template->getTemplateTimestamp());
|
||||||
$_content = $compiler->template->template_source;
|
$_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)) {
|
preg_match_all("!({$this->_ldl}/block(.*?){$this->_rdl})!", $_content, $c)) {
|
||||||
$this->compiler->trigger_template_error('unmatched {block} {/block} pairs');
|
$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]);
|
$_result_count = count($_result[0]);
|
||||||
$_start = 0;
|
$_start = 0;
|
||||||
while ($_start < $_result_count) {
|
while ($_start < $_result_count) {
|
||||||
|
@@ -63,7 +63,7 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
|
|||||||
$this->compiler->has_code = false;
|
$this->compiler->has_code = false;
|
||||||
$_attr = $this->_get_attributes($args);
|
$_attr = $this->_get_attributes($args);
|
||||||
$saved_data = $this->_close_tag(array('function'));
|
$saved_data = $this->_close_tag(array('function'));
|
||||||
$_name = trim($saved_data[0]['name'], "'");
|
$_name = trim($saved_data[0]['name'], "'\"");
|
||||||
// build plugin include code
|
// build plugin include code
|
||||||
$plugins_string = '';
|
$plugins_string = '';
|
||||||
if (!empty($compiler->template->required_plugins['compiled'])) {
|
if (!empty($compiler->template->required_plugins['compiled'])) {
|
||||||
|
@@ -98,11 +98,11 @@ class Smarty_Internal_Resource_Extends {
|
|||||||
$_template->template_filepath = $_filepath;
|
$_template->template_filepath = $_filepath;
|
||||||
$_content = file_get_contents($_filepath);
|
$_content = file_get_contents($_filepath);
|
||||||
if ($_filepath != $_files[count($_files)-1]) {
|
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)) {
|
preg_match_all("!({$this->_ldl}/block(.*?){$this->_rdl})!", $_content, $_close)) {
|
||||||
$this->smarty->trigger_error("unmatched {block} {/block} pairs in file '$_filepath'");
|
$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]);
|
$_result_count = count($_result[0]);
|
||||||
$_start = 0;
|
$_start = 0;
|
||||||
while ($_start < $_result_count) {
|
while ($_start < $_result_count) {
|
||||||
|
Reference in New Issue
Block a user