From a58e5157aa925b9bbf3402629028cba4326cc1df Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 15 Apr 2013 18:23:22 +0200 Subject: [PATCH] Fix one parsing error --- wcfsetup/install/files/js/WCF.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 878da9123f..f518ded461 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -3268,30 +3268,30 @@ WCF.Template = Class.extend({ var self = this; // parse our variable-tags - template = template.replace(/\{(\$.+?)\}/g, function (_, content) { + template = template.replace(/\{(\$[^\s]+?)\}/g, function (_, content) { // unescape \ and ' - content = content.replace(/\$([^\s]+)/g, "(v.$1)").replace(/\\\\/g, '\\').replace(/\\'/g, "'"); + content = content.replace(/\$([^\s]+)/g, "(v['$1'])").replace(/\\\\/g, '\\').replace(/\\'/g, "'"); return "' + WCF.String.escapeHTML(" + content + ") + '"; - }).replace(/\{#(\$.+?)\}/g, function (_, content) { + }).replace(/\{#(\$[^\s]+?)\}/g, function (_, content) { // unescape \ and ' - content = content.replace(/\$([^\s]+)/g, "(v.$1)").replace(/\\\\/g, '\\').replace(/\\'/g, "'"); + content = content.replace(/\$([^\s]+)/g, "(v['$1'])").replace(/\\\\/g, '\\').replace(/\\'/g, "'"); return "' + WCF.String.formatNumeric(" + content + ") + '"; - }).replace(/\{@(\$.+?)\}/g, function (_, content) { + }).replace(/\{@(\$[^\s]+?)\}/g, function (_, content) { // unescape \ and ' - content = content.replace(/\$([^\s]+)/g, "(v.$1)").replace(/\\\\/g, '\\').replace(/\\'/g, "'"); + content = content.replace(/\$([^\s]+)/g, "(v['$1'])").replace(/\\\\/g, '\\').replace(/\\'/g, "'"); return "' + " + content + " + '"; }).replace(/\{if (.+?)\}/g, function (_, content) { // unescape \ and ' - content = content.replace(/\$([^\s]+)/g, "(v.$1)").replace(/\\\\/g, '\\').replace(/\\'/g, "'"); + content = content.replace(/\$([^\s]+)/g, "(v['$1'])").replace(/\\\\/g, '\\').replace(/\\'/g, "'"); return "'; if (" + content + ") { $output += '"; }) - .replace(/\{elseif (.+?)\}/g, function (_, content) { + .replace(/\{else ?if (.+?)\}/g, function (_, content) { // unescape \ and ' - content = content.replace(/\$([^\s]+)/g, "(v.$1)").replace(/\\\\/g, '\\').replace(/\\'/g, "'"); + content = content.replace(/\$([^\s]+)/g, "(v['$1'])").replace(/\\\\/g, '\\').replace(/\\'/g, "'"); return "'; } else if (" + content + ") { $output += '"; }) -- 2.20.1