From eab8a101e7a3fcbb41e01a574985e06c5a3775de Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 18 Oct 2018 02:40:38 +0200 Subject: Updating Smarty --- .../sysplugins/smarty_internal_compile_insert.php | 33 +++++++++++----------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'lib/smarty3/sysplugins/smarty_internal_compile_insert.php') diff --git a/lib/smarty3/sysplugins/smarty_internal_compile_insert.php b/lib/smarty3/sysplugins/smarty_internal_compile_insert.php index 5ef0ac2..56fbc56 100644 --- a/lib/smarty3/sysplugins/smarty_internal_compile_insert.php +++ b/lib/smarty3/sysplugins/smarty_internal_compile_insert.php @@ -1,5 +1,4 @@ getAttributes($compiler, $args); - //Does tag create output - $compiler->has_output = isset($_attr[ 'assign' ]) ? false : true; - $nocacheParam = $compiler->template->caching && ($compiler->tag_nocache || $compiler->nocache); if (!$nocacheParam) { // do not compile as nocache code @@ -66,7 +63,6 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase $_smarty_tpl = $compiler->template; $_name = null; $_script = null; - $_output = 'template->tpl_vars[ $var ])) { $compiler->template->tpl_vars[ $var ]->nocache = true; } else { @@ -96,8 +92,8 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase $_dir = $compiler->smarty instanceof SmartyBC ? $compiler->smarty->trusted_dir : null; } if (!empty($_dir)) { - foreach ((array) $_dir as $_script_dir) { - $_script_dir = rtrim($_script_dir, '/\\') . DS; + foreach ((array)$_dir as $_script_dir) { + $_script_dir = rtrim($_script_dir, '/\\') . DIRECTORY_SEPARATOR; if (file_exists($_script_dir . $_script)) { $_filepath = $_script_dir . $_script; break; @@ -105,15 +101,18 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase } } } - if ($_filepath == false) { + if ($_filepath === false) { $compiler->trigger_template_error("{insert} missing script file '{$_script}'", null, true); } // code for script file loading $_output .= "require_once '{$_filepath}' ;"; - require_once $_filepath; + include_once $_filepath; if (!is_callable($_function)) { - $compiler->trigger_template_error(" {insert} function '{$_function}' is not callable in script file '{$_script}'", - null, true); + $compiler->trigger_template_error( + " {insert} function '{$_function}' is not callable in script file '{$_script}'", + null, + true + ); } } else { $_filepath = 'null'; @@ -122,8 +121,11 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase if (!is_callable($_function)) { // try plugin if (!$_function = $compiler->getPlugin($_name, 'insert')) { - $compiler->trigger_template_error("{insert} no function or plugin found for '{$_name}'", null, - true); + $compiler->trigger_template_error( + "{insert} no function or plugin found for '{$_name}'", + null, + true + ); } } } @@ -149,7 +151,6 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase $_output .= "echo {$_function}({$_params},\$_smarty_tpl);?>"; } } - return $_output; } } -- cgit v1.2.3