]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Revert "[bugfix] Fix redos in preprocessRFC2822 regex (#6015)"
authorIskren Chernev <me@iskren.info>
Wed, 6 Jul 2022 15:53:48 +0000 (18:53 +0300)
committerIskren Chernev <me@iskren.info>
Wed, 6 Jul 2022 15:53:48 +0000 (18:53 +0300)
This reverts commit 7aebb1617fc9bced87ab6bc4c317644019b23ce7.

src/lib/create/from-string.js

index 58739b9d7c6e49936a18808bee7b25f39bcd9dc3..5c4d11f7406fbcb80918868b7bd6ad5981dfbec2 100644 (file)
@@ -151,7 +151,7 @@ function untruncateYear(yearStr) {
 function preprocessRFC2822(s) {
     // Remove comments and folding whitespace and replace multiple-spaces with a single space
     return s
-        .replace(/\([^()]*\)|[\n\t]/g, ' ')
+        .replace(/\([^)]*\)|[\n\t]/g, ' ')
         .replace(/(\s\s+)/g, ' ')
         .replace(/^\s\s*/, '')
         .replace(/\s\s*$/, '');