From: Tim Düsterhus Date: Sun, 12 Feb 2012 12:12:14 +0000 (+0100) Subject: Fix issue with WCF.Template.Compiled and newlines X-Git-Tag: 2.0.0_Beta_1~1355^2^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9df7f79dc8d89ca8a0bbaabe1f0cc9e12ebeb4dc;p=GitHub%2FWoltLab%2FWCF.git Fix issue with WCF.Template.Compiled and newlines --- 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) + "';"); }