From aff836382b0b7574ecc06a5c9de22fde5536171f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 23 Apr 2019 16:54:53 +0200 Subject: [PATCH] Incorrect handling of non countable values passed to `{foreach}` See 745a19744bf6e00843b8f66f24b8b08d409c4149 --- .../lib/system/template/TemplateScriptingCompiler.class.php | 2 +- 1 file changed, 1 insertion(+), 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 010ea46ebe..de430c50ec 100644 --- a/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php +++ b/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php @@ -695,7 +695,7 @@ class TemplateScriptingCompiler { $phpCode .= $foreachHash." = ".$args['from'].";\n"; if (empty($foreachProp)) { - $phpCode .= "if ((is_countable(".$foreachHash.") && count(".$foreachHash.") > 0) || ".$foreachHash.") {\n"; + $phpCode .= "if ((is_countable(".$foreachHash.") && count(".$foreachHash.") > 0) || (!is_countable(".$foreachHash.") && ".$foreachHash.")) {\n"; } else { $phpCode .= $foreachHash."_cnt = (".$foreachHash." !== null ? 1 : 0);\n"; -- 2.20.1