mirror of
https://github.com/smarty-php/smarty.git
synced 2025-12-04 16:29:20 +01:00
- bugfix multiple Smarty::fetch() of same template when $smarty->merge_compiled_includes = true; could cause function alreday defined error
This commit is contained in:
@@ -39,7 +39,8 @@ class Smarty_Internal_Extension_CodeFrame
|
||||
}
|
||||
$output .= "\$_valid = \$_smarty_tpl->decodeProperties(" . var_export($_template->properties, true) . ',' . ($cache ? 'true' : 'false') . ");\n";
|
||||
$output .= "/*/%%SmartyHeaderCode%%*/\n";
|
||||
$output .= "if (\$_valid && !is_callable('{$_template->properties['unifunc']}')) {function {$_template->properties['unifunc']} (\$_smarty_tpl) {\n";
|
||||
$output .= "if (\$_valid && !is_callable('{$_template->properties['unifunc']}')) {\n";
|
||||
$output .= "function {$_template->properties['unifunc']} (\$_smarty_tpl) {\n";
|
||||
// include code for plugins
|
||||
if (!$cache) {
|
||||
if (!empty($_template->required_plugins['compiled'])) {
|
||||
@@ -82,11 +83,12 @@ class Smarty_Internal_Extension_CodeFrame
|
||||
}
|
||||
$output = "<?php\n";
|
||||
$output .= "/*%%SmartyHeaderCode:{$_template->properties['nocache_hash']}%%*/\n";
|
||||
$output .= "if (\$_valid && !is_callable('{$_template->properties['unifunc']}')) {\n";
|
||||
$output .= "function {$_template->properties['unifunc']} (\$_smarty_tpl) {\n";
|
||||
$output .= "?>\n" . $content;
|
||||
$output .= "<?php\n";
|
||||
$output .= "/*/%%SmartyNocache:{$_template->properties['nocache_hash']}%%*/\n";
|
||||
$output .= "}\n?>";
|
||||
$output .= "}\n}\n?>";
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user