mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:47:35 +00:00
LibJS: Reject -00000 as extended year in Date parsing
This commit is contained in:
parent
0399239e3f
commit
9098257668
2 changed files with 4 additions and 0 deletions
|
@ -59,6 +59,9 @@ static Value parse_simplified_iso8601(GlobalObject& global_object, String const&
|
|||
Optional<int> absolute_year;
|
||||
if (!lex_n_digits(6, absolute_year))
|
||||
return false;
|
||||
// The representation of the year 0 as -000000 is invalid.
|
||||
if (absolute_year.value() == 0)
|
||||
return false;
|
||||
year = -absolute_year.value();
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue