From 0c840a5998d0e5deebbb17c2632353cf4dc31d34 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 22 Feb 2015 09:18:35 +0100 Subject: [PATCH] Trimming content inside ... is dangerous --- .../install/files/js/3rdParty/redactor/plugins/wbbcode.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 1335db8c4a..b4d18c8ca9 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -457,7 +457,7 @@ RedactorPlugins.wbbcode = function() { if ($value == '') { var $opening = $openElements.pop(); - var $tmp = $opening.start + $.trim($buffer.pop()) + $opening.end; + var $tmp = $opening.start + $buffer.pop() + $opening.end; if ($buffer.length) { $buffer[$buffer.length - 1] += $tmp; @@ -837,7 +837,6 @@ RedactorPlugins.wbbcode = function() { // [size] data = data.replace(/\[size=(\d+)\]([\s\S]*?)\[\/size\]/gi, (function(match, size, content) { - content = $.trim(content); if (!content.length) { content = this.opts.invisibleSpace; } @@ -847,7 +846,6 @@ RedactorPlugins.wbbcode = function() { // [color] data = data.replace(/\[color=([#a-z0-9]*?)\]([\s\S]*?)\[\/color\]/gi, (function(match, color, content) { - content = $.trim(content); if (!content.length) { content = this.opts.invisibleSpace; } @@ -857,7 +855,6 @@ RedactorPlugins.wbbcode = function() { // [font] data = data.replace(/\[font='?([a-z,\- ]*?)'?\]([\s\S]*?)\[\/font\]/gi, (function(match, fontFamily, content) { - content = $.trim(content); if (!content.length) { content = this.opts.invisibleSpace; } -- 2.20.1