Skip to content
Permalink
Browse files

Merge pull request #2939 from rvagg:regex-dos-no-more

use full-string match to speed up aspnet regex match
  • Loading branch information...
ichernev committed Feb 3, 2016
2 parents 49f84cc + 34af63b commit 52a807b961ead925be11ff5e632c8f7325a9ce36
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/lib/duration/create.js
@@ -6,7 +6,7 @@ import { cloneWithOffset } from '../units/offset';
import { createLocal } from '../create/local';

// ASP.NET json date format regex
var aspNetRegex = /(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/;
var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/;

// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere

0 comments on commit 52a807b

Please sign in to comment.
You can’t perform that action at this time.