Prevent matching background-color as color
authorAlexander Ebert <ebert@woltlab.com>
Sat, 7 Mar 2015 22:36:13 +0000 (23:36 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 7 Mar 2015 22:36:13 +0000 (23:36 +0100)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js

index a69c7a8f029194877d4173d5616787265aef1f92..81f4b4d71f7bc5be33715b792c1af2df53d765b7 100644 (file)
@@ -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 + ']';