mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-04 11:44:16 +02:00
Use require_once
This commit is contained in:
@@ -141,7 +141,7 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
|
||||
if (!empty($compiler->template->required_plugins['compiled'])) {
|
||||
foreach ($compiler->template->required_plugins['compiled'] as $tmp) {
|
||||
foreach ($tmp as $data) {
|
||||
$output .= "if (!is_callable('{$data['function']}')) include '{$data['file']}';\n";
|
||||
$output .= "if (!is_callable('{$data['function']}')) require_once '{$data['file']}';\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
|
||||
$output .= "echo '/*%%SmartyNocache:{$compiler->template->properties['nocache_hash']}%%*/<?php ";
|
||||
foreach ($compiler->template->required_plugins['nocache'] as $tmp) {
|
||||
foreach ($tmp as $data) {
|
||||
$output .= "if (!is_callable(\'{$data['function']}\')) include \'{$data['file']}\';\n";
|
||||
$output .= "if (!is_callable(\'{$data['function']}\')) require_once \'{$data['file']}\';\n";
|
||||
}
|
||||
}
|
||||
$output .= "?>/*/%%SmartyNocache:{$compiler->template->properties['nocache_hash']}%%*/';\n";
|
||||
@@ -185,7 +185,7 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
|
||||
if (!empty($compiler->template->required_plugins['compiled'])) {
|
||||
foreach ($compiler->template->required_plugins['compiled'] as $tmp) {
|
||||
foreach ($tmp as $data) {
|
||||
$output .= "if (!is_callable('{$data['function']}')) include '{$data['file']}';\n";
|
||||
$output .= "if (!is_callable('{$data['function']}')) require_once '{$data['file']}';\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,9 +46,9 @@ class Smarty_Internal_Extension_CodeFrame
|
||||
foreach ($tmp as $data) {
|
||||
$file = addslashes($data['file']);
|
||||
if (is_Array($data['function'])) {
|
||||
$output .= "if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) include '{$file}';\n";
|
||||
$output .= "if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) require_once '{$file}';\n";
|
||||
} else {
|
||||
$output .= "if (!is_callable('{$data['function']}')) include '{$file}';\n";
|
||||
$output .= "if (!is_callable('{$data['function']}')) require_once '{$file}';\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60,9 +60,9 @@ class Smarty_Internal_Extension_CodeFrame
|
||||
foreach ($tmp as $data) {
|
||||
$file = addslashes($data['file']);
|
||||
if (is_Array($data['function'])) {
|
||||
$output .= addslashes("if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) include '{$file}';\n");
|
||||
$output .= addslashes("if (!is_callable(array('{$data['function'][0]}','{$data['function'][1]}'))) require_once '{$file}';\n");
|
||||
} else {
|
||||
$output .= addslashes("if (!is_callable('{$data['function']}')) include '{$file}';\n");
|
||||
$output .= addslashes("if (!is_callable('{$data['function']}')) require_once '{$file}';\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -701,7 +701,7 @@ abstract class Smarty_Internal_TemplateCompilerBase
|
||||
$this->template->required_plugins['compiled'][$tag][$plugin_type]['file'] = $script;
|
||||
$this->template->required_plugins['compiled'][$tag][$plugin_type]['function'] = $callback;
|
||||
}
|
||||
include_once $script;
|
||||
require_once $script;
|
||||
} else {
|
||||
$this->trigger_template_error("Default plugin handler: Returned script file \"{$script}\" for \"{$tag}\" not found");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user