diff options
author | Philip Graham <philip.robert.graham@gmail.com> | 2011-06-28 16:40:28 +0000 |
---|---|---|
committer | Philip Graham <philip.robert.graham@gmail.com> | 2011-06-28 16:40:28 +0000 |
commit | 76e2b98a312cfab3d754aac5068ad965e544840c (patch) | |
tree | 9f0707aba5a98901b22fea02cde2a43910dca5c2 /ui | |
parent | 5c34cea06fb84777e1af72acf5ff0e9b60bd96f2 (diff) | |
download | jquery-ui-76e2b98a312cfab3d754aac5068ad965e544840c.tar.gz jquery-ui-76e2b98a312cfab3d754aac5068ad965e544840c.zip |
Updated guard against unparsed characters to allow extra characters as long as they are separated from the date by whitespace. This maintains compatibility with timepicker extensions.
Fixes #7244 - Datepicker: parseDate() does not throw an exception for long years
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.datepicker.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 1d3de7740..45107c969 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -1095,7 +1095,10 @@ $.extend(Datepicker.prototype, { } } if (iValue < value.length){ - throw "Extra/unparsed characters found in date: " + value.substring(iValue); + var extra = value.substr(iValue); + if (!/^\s+/.test(extra)) { + throw "Extra/unparsed characters found in date: " + extra; + } } if (year == -1) year = new Date().getFullYear(); |