From 9df7f79dc8d89ca8a0bbaabe1f0cc9e12ebeb4dc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 12 Feb 2012 13:12:14 +0100 Subject: [PATCH] Fix issue with WCF.Template.Compiled and newlines --- wcfsetup/install/files/js/WCF.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 32737b7132..7b48e9245f 100644 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -2403,6 +2403,9 @@ WCF.Template.prototype = { // insert delimiter tags $compiled = $compiled.replace('{ldelim}', '{').replace('{rdelim}', '}'); + // escape newlines + $compiled = $compiled.replace(/(\r\n|\n|\r)/g, '\\n'); + // and re-insert saved literals return new WCF.Template.Compiled("'" + this.insertLiterals($compiled) + "';"); } -- 2.20.1