Page MenuHomePhabricator

#time parser function silently "mitigates" incorrect dates with month days overflow instead of producing error
Open, Needs TriagePublicBUG REPORT

Description

Mediawiki time parser function silently "mitigates" incorrect date (with day > max month days (in given year) and ≤ 31) by wrapping days into next month,
e.g.:

  • {{#time:Y-m-d|2001-02-29}} ⇒ 2001-03-01
  • {{#time:Y-m-d|2000-02-30}} ⇒ 2000-03-01
  • {{#time:Y-m-d|2000-02-31}} ⇒ 2000-03-02
  • {{#time:Y-m-d|2001-02-31}} ⇒ 2001-03-03
  • {{#time:Y-m-d|2000-04-31}} ⇒ 2000-05-01
  • {{#time:Y-m-d|2000-06-31}} ⇒ 2000-07-01
  • {{#time:Y-m-d|2000-09-31}} ⇒ 2000-10-01
  • {{#time:Y-m-d|2000-11-31}} ⇒ 2000-12-01

vs e.g.:

  • {{#time:Y-m-d|2000-01-32}} ⇒ Error: Invalid time.

Event Timeline

mykhal updated the task description. (Show Details)

Change #1214031 had a related patch set uploaded (by Adarsh2406; author: Adarsh2406):

[mediawiki/extensions/ParserFunctions@master] T411471: Validate ISO date parsing to reject invalid day values

https://gerrit.wikimedia.org/r/1214031

mykhal renamed this task from #time parser function silently "mitigates" month days overflow instead of producing error to #time parser function silently "mitigates" incorrect dates with month days overflow instead of producing error.Thu, Dec 4, 5:13 PM