mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
Fix ReDos in CSS_RGB and CSS_RGBA
This commit is contained in:
parent
51d1a37b00
commit
1e1aecb579
@ -58,7 +58,7 @@ const INTERPRETATIONS = [
|
|||||||
|
|
||||||
CSS_RGB: {
|
CSS_RGB: {
|
||||||
read: function(original) {
|
read: function(original) {
|
||||||
const test = original.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
|
const test = original.match(/^rgb\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);
|
||||||
if (test === null) {
|
if (test === null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ const INTERPRETATIONS = [
|
|||||||
|
|
||||||
CSS_RGBA: {
|
CSS_RGBA: {
|
||||||
read: function(original) {
|
read: function(original) {
|
||||||
const test = original.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
|
const test = original.match(/^rgba\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);
|
||||||
if (test === null) {
|
if (test === null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user