From eab8a101e7a3fcbb41e01a574985e06c5a3775de Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 18 Oct 2018 02:40:38 +0200 Subject: Updating Smarty --- .../smarty_internal_compile_include_php.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'lib/smarty3/sysplugins/smarty_internal_compile_include_php.php') diff --git a/lib/smarty3/sysplugins/smarty_internal_compile_include_php.php b/lib/smarty3/sysplugins/smarty_internal_compile_include_php.php index a2edd42..1b0fdaa 100644 --- a/lib/smarty3/sysplugins/smarty_internal_compile_include_php.php +++ b/lib/smarty3/sysplugins/smarty_internal_compile_include_php.php @@ -43,7 +43,7 @@ class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase /** * Compiles code for the {include_php} tag * - * @param array $args array with attributes from parser + * @param array $args array with attributes from parser * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return string @@ -57,8 +57,10 @@ class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase } // check and get attributes $_attr = $this->getAttributes($compiler, $args); - - /** @var Smarty_Internal_Template $_smarty_tpl + /** + * + * + * @var Smarty_Internal_Template $_smarty_tpl * used in evaluated code */ $_smarty_tpl = $compiler->template; @@ -74,8 +76,8 @@ class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase $_dir = $compiler->smarty->trusted_dir; } if (!empty($_dir)) { - foreach ((array) $_dir as $_script_dir) { - $_path = $compiler->smarty->_realpath($_script_dir . DS . $_file, true); + foreach ((array)$_dir as $_script_dir) { + $_path = $compiler->smarty->_realpath($_script_dir . DIRECTORY_SEPARATOR . $_file, true); if (file_exists($_path)) { $_filepath = $_path; break; @@ -83,25 +85,22 @@ class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase } } } - if ($_filepath == false) { + if ($_filepath === false) { $compiler->trigger_template_error("{include_php} file '{$_file}' is not readable", null, true); } - if (isset($compiler->smarty->security_policy)) { $compiler->smarty->security_policy->isTrustedPHPDir($_filepath); } - if (isset($_attr[ 'assign' ])) { // output will be stored in a smarty variable instead of being displayed $_assign = $_attr[ 'assign' ]; } $_once = '_once'; if (isset($_attr[ 'once' ])) { - if ($_attr[ 'once' ] == 'false') { + if ($_attr[ 'once' ] === 'false') { $_once = ''; } } - if (isset($_assign)) { return "assign({$_assign},ob_get_clean());\n?>"; } else { -- cgit v1.2.3