mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 19:34:27 +02:00
- bugfix on {function} tags and template inheritance
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
12/10/2009
|
||||||
|
- bugfix on {function} tags and template inheritance
|
||||||
|
|
||||||
12/05/2009
|
12/05/2009
|
||||||
- fixed problem when a cached file was fetched several times
|
- fixed problem when a cached file was fetched several times
|
||||||
- removed unneeded lexer code
|
- removed unneeded lexer code
|
||||||
|
@@ -66,6 +66,8 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase {
|
|||||||
$_tpl = $this->smarty->createTemplate('string:' . $this->smarty->block_data[$_name]['source'], null, null, $compiler->template);
|
$_tpl = $this->smarty->createTemplate('string:' . $this->smarty->block_data[$_name]['source'], null, null, $compiler->template);
|
||||||
$_tpl->template_filepath = $this->smarty->block_data[$_name]['file'];
|
$_tpl->template_filepath = $this->smarty->block_data[$_name]['file'];
|
||||||
$_tpl->forceNocache = true;
|
$_tpl->forceNocache = true;
|
||||||
|
$_tpl->suppressHeader = true;
|
||||||
|
$_tpl->suppressFileDependency = true;
|
||||||
|
|
||||||
if (strpos($this->smarty->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) {
|
if (strpos($this->smarty->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) {
|
||||||
$_output = str_replace('%%%%SMARTY_PARENT%%%%', $compiler->template->extracted_compiled_code, $_tpl->getCompiledTemplate());
|
$_output = str_replace('%%%%SMARTY_PARENT%%%%', $compiler->template->extracted_compiled_code, $_tpl->getCompiledTemplate());
|
||||||
@@ -75,20 +77,14 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase {
|
|||||||
$_output = $compiler->template->extracted_compiled_code . $_tpl->getCompiledTemplate();
|
$_output = $compiler->template->extracted_compiled_code . $_tpl->getCompiledTemplate();
|
||||||
} elseif (!empty($this->smarty->block_data[$_name])) {
|
} elseif (!empty($this->smarty->block_data[$_name])) {
|
||||||
$_output = $_tpl->getCompiledTemplate();
|
$_output = $_tpl->getCompiledTemplate();
|
||||||
}
|
}
|
||||||
unset($tpl);
|
$compiler->template->properties = array_merge_recursive($compiler->template->properties, $_tpl->properties);
|
||||||
|
unset($_tpl);
|
||||||
} else {
|
} else {
|
||||||
$_output = $compiler->template->extracted_compiled_code;
|
$_output = $compiler->template->extracted_compiled_code;
|
||||||
}
|
}
|
||||||
$compiler->template->extracted_compiled_code = $saved_data[1];
|
$compiler->template->extracted_compiled_code = $saved_data[1];
|
||||||
$compiler->template->extract_code = $saved_data[2];
|
$compiler->template->extract_code = $saved_data[2];
|
||||||
// check for includes in block tags
|
|
||||||
preg_match('/(\<\?php \$_smarty_tpl-\>decodeProperties\(\')(.*)(\'.*\?\>)/', $_output, $matches);
|
|
||||||
$_output = preg_replace(array('/(\<\?php \$_smarty_tpl-\>decodeProperties\(\')(.*)(\'.*\?\>.*\n)/', '/(\<\?php if\(\!defined\(\'SMARTY_DIR\'\)\))(.*)(\?\>.*\n)/'), '', $_output);
|
|
||||||
if (isset($matches[2])) {
|
|
||||||
$prop = unserialize($matches[2]);
|
|
||||||
$compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $prop['file_dependency']);
|
|
||||||
}
|
|
||||||
return $_output;
|
return $_output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user