Skip to content

Commit ad38dc0

Browse files
blikblumjdalton
authored andcommitted
Prevent ReDos in words (lodash#4450)
1 parent 0e9d44e commit ad38dc0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

words.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import unicodeWords from './.internal/unicodeWords.js'
22

33
const hasUnicodeWord = RegExp.prototype.test.bind(
4-
/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/
4+
/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/
55
)
66

77
/** Used to match words composed of alphanumeric characters. */

0 commit comments

Comments
 (0)