From: Iskren Chernev Date: Wed, 6 Jul 2022 15:53:48 +0000 (+0300) Subject: Revert "[bugfix] Fix redos in preprocessRFC2822 regex (#6015)" X-Git-Tag: 2.29.4~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4e615307ee350b58ac9899e3587ce43972b0753;p=thirdparty%2Fmoment.git Revert "[bugfix] Fix redos in preprocessRFC2822 regex (#6015)" This reverts commit 7aebb1617fc9bced87ab6bc4c317644019b23ce7. --- diff --git a/src/lib/create/from-string.js b/src/lib/create/from-string.js index 58739b9d7..5c4d11f74 100644 --- a/src/lib/create/from-string.js +++ b/src/lib/create/from-string.js @@ -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*$/, '');