From 3b223ebe9d364af7f518ff7dfbf652234391ab2a Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Fri, 15 May 2015 15:46:24 +0200 Subject: [PATCH] Strip newlines when compiling if conditions in templates Previously, the compiler could handle most situations with newlines but had issues in certain situations with closing parentheses being followed by a newline. This case is relevant when code of multiple template listeners is inserted at the end of an if condition as the template engine concatenates template listener code by newlines. --- .../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 7a4dfa3390..9b595d235a 100644 --- a/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php +++ b/wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php @@ -933,7 +933,7 @@ class TemplateScriptingCompiler { */ protected function compileIfTag($tagArgs, $elseif = false) { $tagArgs = $this->replaceQuotes($tagArgs); - $tagArgs = str_replace(' ', '', $tagArgs); + $tagArgs = str_replace(array(' ', "\n"), '', $tagArgs); // split tags preg_match_all('~('.$this->conditionOperatorPattern.')~', $tagArgs, $matches); -- 2.20.1