From 483fe3290a2f5b0fab394d0696f46c89d66745fb Mon Sep 17 00:00:00 2001 From: "glazman%netscape.com" Date: Tue, 13 Aug 2002 10:11:30 +0000 Subject: [PATCH] fixing bad regexp for rgv(r,g,b) parsing; b=161890, r=neil@parkwaycc.co.uk, sr=bzbarsky --- editor/ui/composer/content/editorUtilities.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/editor/ui/composer/content/editorUtilities.js b/editor/ui/composer/content/editorUtilities.js index dfcd1c2823c4..eca5d81fca3f 100644 --- a/editor/ui/composer/content/editorUtilities.js +++ b/editor/ui/composer/content/editorUtilities.js @@ -868,9 +868,7 @@ function GetOS() function ConvertRGBColorIntoHEXColor(color) { - if (color.search( /rgb.*/ ) != -1) - { - var res = color.match( /rgb\((\d*),(\d*),(\d*)\)/ ); + if ( /rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.test(color) ) { var r = Number(RegExp.$1).toString(16); if (r.length == 1) r = "0"+r; var g = Number(RegExp.$2).toString(16);