From a44229d2c5c3d8c7a945e03234fff8bcc70ffb31 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 13 Feb 2012 14:34:27 +0100 Subject: [PATCH] Fixed variable passing for static includes Previously it was not possible to pass boolean values or numbers, because they were not recognized as valid value (even though they actually are). --- .../lib/system/template/TemplateScriptingCompiler.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php b/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php index 41689e0861..aeb9cb42c1 100644 --- a/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php +++ b/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php @@ -781,14 +781,17 @@ class TemplateScriptingCompiler { if (!empty($args)) { foreach ($args as $variable => $value) { if (substr($value, 0, 1) == "'") { + // string values $phpCode .= "\$this->v['".$variable."'] = ".$value.";\n"; } else { if (preg_match('~^\$this->v\[\'(.*)\'\]$~U', $value, $matches)) { + // value is a variable itself $phpCode .= "\$this->v['".$variable."'] = ".$value.";\n"; } else { - throw new SystemException("Could not resolve variable type for value '".$value."'"); + // value is boolean, an integer or anything else + $phpCode .= "\$this->v['".$variable."'] = ".$value.";\n"; } } } -- 2.20.1