Skip to content

Commit

Permalink
Merge pull request #2939 from rvagg:regex-dos-no-more
Browse files Browse the repository at this point in the history
use full-string match to speed up aspnet regex match
  • Loading branch information
ichernev committed Feb 3, 2016
2 parents 49f84cc + 34af63b commit 52a807b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/duration/create.js
Expand Up @@ -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
Expand Down

0 comments on commit 52a807b

Please sign in to comment.