From db7c515028d50850695fc17ef81ee1a1862a802d Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 14 Jul 2014 12:52:26 +0200 Subject: [PATCH] Fixed an issue related to static includes --- .../system/template/TemplateScriptingCompiler.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php b/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php index 0551e59261..16021b3328 100644 --- a/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php +++ b/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php @@ -759,7 +759,7 @@ class TemplateScriptingCompiler { $sandbox = ($sandbox === 'true' || $sandbox === true || $sandbox == 1); $staticInclude = true; - if ($sandbox || $assignVar === false || $once === false || !empty($args)) { + if ($sandbox || $assignVar !== false || $once !== false || strpos($application, '$') !== false) { $staticInclude = false; } @@ -823,7 +823,10 @@ class TemplateScriptingCompiler { $phpCode .= "ob_start();\n"; } - $phpCode .= '$this->includeTemplate('.$file.', \''.$application.'\', array('.$argString.'), '.($sandbox ? 1 : 0).');'."\n"; + if (strpos($application, '$') === false) { + $application = "'" . $application . "'"; + } + $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