From 52aff1a169cec4262fac146f426b65754d432876 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 7 Mar 2015 23:36:13 +0100 Subject: [PATCH] Prevent matching background-color as color --- .../install/files/js/3rdParty/redactor/plugins/wbbcode.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index a69c7a8f02..81f4b4d71f 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -505,7 +505,7 @@ RedactorPlugins.wbbcode = function() { var $start; var $end; - if ($style.match(/color: ?rgb\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\);?/i)) { + if ($style.match(/(?:^|;\s*)color: ?rgb\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\);?/i)) { var $r = RegExp.$1; var $g = RegExp.$2; var $b = RegExp.$3; @@ -516,7 +516,7 @@ RedactorPlugins.wbbcode = function() { if ($searchFor.indexOf('color') === -1) $searchFor.push('color'); } - else if ($style.match(/color: ?([^;]+);?/i)) { + else if ($style.match(/(?:^|;\s*)color: ?([^;]+);?/i)) { $start = '[color=' + RegExp.$1 + ']'; $end = '[/color=' + RegExp.$1 + ']'; -- 2.20.1