mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
Merge pull request #279 from yetingli/master
Fix ReDos in CSS_RGB and CSS_RGBA
This commit is contained in:
commit
f720c729de
@ -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