From: Alexander Ebert Date: Mon, 19 Jan 2015 00:29:20 +0000 (+0100) Subject: Filter out script tags and skip newlines in text nodes X-Git-Tag: 2.1.0_Beta_4~64^2~12 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f4fbfbb7fd3b649d050658a51652d94d83f29cbf;p=GitHub%2FWoltLab%2FWCF.git Filter out script tags and skip newlines in text nodes --- 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, ''); } }