projects
/
GitHub
/
WoltLab
/
WCF.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0c982e3
)
Fix issue with WCF.Template.Compiled and newlines
author
Tim Düsterhus
<timwolla@arcor.de>
Sun, 12 Feb 2012 12:12:14 +0000
(13:12 +0100)
committer
Tim Düsterhus
<timwolla@arcor.de>
Sun, 12 Feb 2012 12:12:14 +0000
(13:12 +0100)
wcfsetup/install/files/js/WCF.js
patch
|
blob
|
blame
|
history
diff --git
a/wcfsetup/install/files/js/WCF.js
b/wcfsetup/install/files/js/WCF.js
index 32737b7132b3f1cf98863ed7e7b8f816085cb30a..7b48e9245fe53c652687b5d2ea183836336345a3 100644
(file)
--- 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) + "';");
}