Prevent ReDos in words (#4450)

This commit is contained in:
Luiz Américo
2019-08-28 20:07:13 -03:00
committed by John-David Dalton
parent 0e9d44eedb
commit ad38dc0115

View File

@@ -1,7 +1,7 @@
import unicodeWords from './.internal/unicodeWords.js'
const hasUnicodeWord = RegExp.prototype.test.bind(
/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/
/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/
)
/** Used to match words composed of alphanumeric characters. */