Filter out script tags and skip newlines in text nodes
authorAlexander Ebert <ebert@woltlab.com>
Mon, 19 Jan 2015 00:29:20 +0000 (01:29 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 19 Jan 2015 00:29:20 +0000 (01:29 +0100)
wcfsetup/install/files/js/WCF.Message.js

index a1f8ed8e41b3f3e88716983e19691fcc7fb7f363..dd0a35a72418b9d00a973898c9faec4202719bdb 100644 (file)
@@ -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, '');
                        }
                        
                }