From: Alexander Ebert Date: Sat, 7 Mar 2015 22:36:13 +0000 (+0100) Subject: Prevent matching background-color as color X-Git-Tag: 2.1.2~77 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=52aff1a169cec4262fac146f426b65754d432876;p=GitHub%2FWoltLab%2FWCF.git Prevent matching background-color as color --- 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 + ']';