mirror of
https://github.com/bellard/quickjs.git
synced 2025-11-15 18:22:15 +03:00
stricter year parsing in Date
This commit is contained in:
@@ -53839,11 +53839,11 @@ static BOOL js_date_parse_otherstring(const uint8_t *sp,
|
||||
*is_local = FALSE;
|
||||
}
|
||||
} else {
|
||||
if (p - p_start > 2) {
|
||||
if (p - p_start > 2 && !has_year) {
|
||||
fields[0] = val;
|
||||
has_year = TRUE;
|
||||
} else
|
||||
if (val < 1 || val > 31) {
|
||||
if ((val < 1 || val > 31) && !has_year) {
|
||||
fields[0] = val + (val < 100) * 1900 + (val < 50) * 100;
|
||||
has_year = TRUE;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user