From f4fbfbb7fd3b649d050658a51652d94d83f29cbf Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 19 Jan 2015 01:29:20 +0100 Subject: [PATCH] Filter out script tags and skip newlines in text nodes --- wcfsetup/install/files/js/WCF.Message.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.Message.js b/wcfsetup/install/files/js/WCF.Message.js index a1f8ed8e41..dd0a35a724 100644 --- a/wcfsetup/install/files/js/WCF.Message.js +++ b/wcfsetup/install/files/js/WCF.Message.js @@ -1981,7 +1981,7 @@ WCF.Message.Quote.Handler = Class.extend({ _getNodeText: function(node) { // work-around for IE, see http://stackoverflow.com/a/5983176 var $nodeFilter = function(node) { - if (node.tagName === 'H3') { + if (node.tagName === 'H3' || node.tagName === 'SCRIPT') { return NodeFilter.FILTER_REJECT; } @@ -2016,7 +2016,7 @@ WCF.Message.Quote.Handler = Class.extend({ } } else { - $text += $walker.currentNode.nodeValue; + $text += $node.nodeValue.replace(/\n/g, ''); } } -- 2.20.1