From 13a5792885a2d1e922222baee147a58d75e7906a Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 29 Jun 2014 12:27:19 +0200 Subject: [PATCH] Fixed static includes --- .../template/TemplateScriptingCompiler.class.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php b/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php index 8d9ba1d616..0551e59261 100644 --- a/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php +++ b/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php @@ -757,14 +757,16 @@ class TemplateScriptingCompiler { } $sandbox = ($sandbox === 'true' || $sandbox === true || $sandbox == 1); - if (!$sandbox && !empty($args)) { - $sandbox = true; + + $staticInclude = true; + if ($sandbox || $assignVar === false || $once === false || !empty($args)) { + $staticInclude = false; } $templateName = substr($file, 1, -1); // check for static includes - if (!$sandbox && $assignVar === false && $once === false) { + if ($staticInclude) { $phpCode = ''; if (!isset($this->staticIncludes[$application])) { $this->staticIncludes[$application] = array(); @@ -821,7 +823,7 @@ class TemplateScriptingCompiler { $phpCode .= "ob_start();\n"; } - $phpCode .= '$this->includeTemplate('.$file.', \''.$application.'\', array('.$argString.'), ('.$sandbox.' ? 1 : 0));'."\n"; + $phpCode .= '$this->includeTemplate('.$file.', \''.$application.'\', array('.$argString.'), '.($sandbox ? 1 : 0).');'."\n"; if ($assignVar !== false) { $phpCode .= '$this->'.($append ? 'append' : 'assign').'('.$assignVar.', ob_get_clean());'."\n"; -- 2.20.1