From: Alexander Ebert Date: Mon, 14 Jul 2014 10:52:26 +0000 (+0200) Subject: Fixed an issue related to static includes X-Git-Tag: 2.1.0_Alpha_1~573 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=db7c515028d50850695fc17ef81ee1a1862a802d;p=GitHub%2FWoltLab%2FWCF.git Fixed an issue related to static includes --- 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";