mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-04 03:40:53 +02:00
- bugfix the default plugin handler did create wrong compiled code for static class methods
from external script files (issue 108)
This commit is contained in:
@@ -344,7 +344,11 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
|
||||
foreach ($this->required_plugins['compiled'] as $tmp) {
|
||||
foreach ($tmp as $data) {
|
||||
$file = addslashes($data['file']);
|
||||
$plugins_string .= "if (!is_callable('{$data['function']}')) include '{$file}';\n";
|
||||
if (is_Array($data['function'])){
|
||||
$plugins_string .= "if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) include '{$file}';\n";
|
||||
} else {
|
||||
$plugins_string .= "if (!is_callable('{$data['function']}')) include '{$file}';\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
$plugins_string .= '?>';
|
||||
@@ -355,7 +359,11 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
|
||||
foreach ($this->required_plugins['nocache'] as $tmp) {
|
||||
foreach ($tmp as $data) {
|
||||
$file = addslashes($data['file']);
|
||||
$plugins_string .= addslashes("if (!is_callable('{$data['function']}')) include '{$file}';\n");
|
||||
if (is_Array($data['function'])){
|
||||
$plugins_string .= addslashes("if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) include '{$file}';\n");
|
||||
} else {
|
||||
$plugins_string .= addslashes("if (!is_callable('{$data['function']}')) include '{$file}';\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
$plugins_string .= "?>/*/%%SmartyNocache:{$this->properties['nocache_hash']}%%*/';?>\n";
|
||||
|
||||
Reference in New Issue
Block a user