mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
- bugfix removed ambiguity between ternary and stream variable in template syntax
- bugfix use caching properties of template instead of smarty object when compiling child {block} - bugfix {*block}...{/block*} did throw an exception in template inheritance
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
13/10/2010
|
||||
- bugfix removed ambiguity between ternary and stream variable in template syntax
|
||||
- bugfix use caching properties of template instead of smarty object when compiling child {block}
|
||||
- bugfix {*block}...{/block*} did throw an exception in template inheritance
|
||||
|
||||
|
||||
===== RC4 =====
|
||||
|
||||
01/10/2010
|
||||
- added {break} and {continue} tags for flow control of {foreach},{section},{for} and {while} loops
|
||||
- change of 'string' resource. It's no longer evaluated and compiled files are now stored
|
||||
|
@@ -71,7 +71,9 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase {
|
||||
}
|
||||
$_name = trim($saved_data[0]['name'], "\"'");
|
||||
if (isset($compiler->template->block_data[$_name])) {
|
||||
$_tpl = $this->smarty->createTemplate('eval:' . $compiler->template->block_data[$_name]['source'], null, null, $compiler->template);
|
||||
// $_tpl = $this->smarty->createTemplate('eval:' . $compiler->template->block_data[$_name]['source'], null, null, $compiler->template);
|
||||
$_tpl = new Smarty_Internal_template ('eval:' . $compiler->template->block_data[$_name]['source'], $this->smarty, $compiler->template, $compiler->template->cache_id,
|
||||
$compiler->template->compile_id = null, $compiler->template->caching, $compiler->template->cache_lifetime);
|
||||
$_tpl->properties['nocache_hash'] = $compiler->template->properties['nocache_hash'];
|
||||
$_tpl->template_filepath = $compiler->template->block_data[$_name]['file'];
|
||||
if ($compiler->nocache) {
|
||||
|
@@ -43,10 +43,10 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase {
|
||||
$compiler->template->properties['file_dependency'][$template_sha1] = array($_template->getTemplateFilepath(), $_template->getTemplateTimestamp());
|
||||
$_content = $compiler->template->template_source;
|
||||
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');
|
||||
}
|
||||
preg_match_all("!{$this->_ldl}block\s(.+?){$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) {
|
||||
|
@@ -104,10 +104,10 @@ class Smarty_Internal_Resource_Extends {
|
||||
$_content = file_get_contents($_filepath);
|
||||
if ($_filepath != $_last) {
|
||||
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'");
|
||||
}
|
||||
preg_match_all("!{$this->_ldl}block\s(.+?){$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) {
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user