diff options
author | Rodrigo Menezes <rod333@gmail.com> | 2014-05-15 17:16:09 -0400 |
---|---|---|
committer | TJ VanToll <tj.vantoll@gmail.com> | 2014-07-14 09:34:33 -0400 |
commit | 573037423822fa04a1888e3bcc52243b9324c5e2 (patch) | |
tree | 45ed50ff3a744482edf905844a55ed0ed7f8ec68 /ui/datepicker.js | |
parent | bef2c456cafb60951a71386ed0b21ee7f7ae65c8 (diff) | |
download | jquery-ui-573037423822fa04a1888e3bcc52243b9324c5e2.tar.gz jquery-ui-573037423822fa04a1888e3bcc52243b9324c5e2.zip |
Datepicker: reject dates with two year digits when expecting 'yy'
Fixes #8353
Closes gh-1248
Diffstat (limited to 'ui/datepicker.js')
-rw-r--r-- | ui/datepicker.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/datepicker.js b/ui/datepicker.js index 10b7d7eb5..46b6a5f4d 100644 --- a/ui/datepicker.js +++ b/ui/datepicker.js @@ -1138,7 +1138,8 @@ $.extend(Datepicker.prototype, { var isDoubled = lookAhead(match), size = (match === "@" ? 14 : (match === "!" ? 20 : (match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))), - digits = new RegExp("^\\d{1," + size + "}"), + minSize = (match === "y" ? size : 1), + digits = new RegExp("^\\d{" + minSize + "," + size + "}"), num = value.substring(iValue).match(digits); if (!num) { throw "Missing number at position " + iValue; |