Page MenuHomePhabricator

DiscussionTools handle out of range dates
Closed, ResolvedPublic

Description

Following on from T350633, this task involves the work of making date handling for dates out of the "expected" range consistent so that comment with invalid timestamps can be replied to.

Event Timeline

so that comment with invalid timestamps can be replied to

I don't thinks we should support invalid timestamps. We don't support timestamps with a broken timezone, or a month name we don't recognise, so we shouldn't support nonsensical digits either.

We should however "handle" these as the title suggest, but we should detect the invalid numbers not count them as signatures at all, showing no reply link.

I looked into this a bit, and the problem isn't that the year is 0 (both our PHP and JS timestamp libraries support the non-existent year 0), or even that the day is 0 (which just gets read as "1").

The problem is the timezone (Central European Time), which is one hour ahead of UTC, so while it is year 00:00 1st Jan 0 in France, it then converts to UTC for the ID, where it is 31st December in the year -1, and negative years are apparently a step too far...

Change 979137 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/DiscussionTools@master] Ignore signatures with invalid timestamps

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

Change 979137 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Ignore signatures with invalid timestamps

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

matmarex assigned this task to Esanders.