Skip to content

Commit

Permalink
Fixed regular expression denial of service (ReDoS) vulnerability
Browse files Browse the repository at this point in the history
  • Loading branch information
knowledgecode committed Dec 24, 2020
1 parent 73103a3 commit 9e4b501
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion date-and-time.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
* @returns {Array.<string>} a compiled object
*/
date.compile = function (formatString) {
var re = /\[([^\[\]]*|\[[^\[\]]*\])*\]|([A-Za-z])\2+|\.{3}|./g, keys, pattern = [formatString];
var re = /\[([^\[\]]|\[[^\[\]]*])*]|([A-Za-z])\2+|\.{3}|./g, keys, pattern = [formatString];

while ((keys = re.exec(formatString))) {
pattern[pattern.length] = keys[0];
Expand Down
14 changes: 7 additions & 7 deletions date-and-time.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9e4b501

Please sign in to comment.