Last modified: 2013-11-02 16:39:38 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T35579, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33579 - #time: function gives strange results with invalid month names (rather than erroring out)
#time: function gives strange results with invalid month names (rather than e...
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
ParserFunctions (Other open bugs)
unspecified
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-07 12:49 UTC by Lejonel
Modified: 2013-11-02 16:39 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Lejonel 2012-01-07 12:49:25 UTC
On Swedish Wikipedia someone by mistake used a Swedish month name in the date "9 juni 2011" passed to #time: parser function. Even if month names should be in English, this worked in 2011. But the mistake showed up now in 2012, when the #time: function thought this was 9 June 2012.

It seems #time accepts time formats "day month year" with an lower case 'i' added at the end of the month name, both in full and abbreviated month names, and in Roman numeral months. But for years 2000 to 2059 these dates are somehow parsed as the current year. For years before 2000 or after 2059 the years are fine. Here are some examples of results from Wikipedia (both English and Swedish):

{{#time: Y-m-d|9 juni 1999}}      displays as   1999-06-09   (correct year)
{{#time: Y-m-d|9 juni 2000}}      displays as   2012-06-09   (wrong year)
{{#time: Y-m-d|9 decemberi 2020}} displays as   2012-12-09   (wrong year)
{{#time: Y-m-d|10 Xi 2030}}       displays as   2012-10-10   (wrong year)
{{#time: Y-m-d|10 januaryi 2059}} displays as   2012-01-10   (wrong year)
{{#time: Y-m-d|10 januaryi 2060}} displays as   2060-01-10   (correct year)

Expected results I think is "Error: invalid time".
Comment 1 Lejonel 2012-01-17 19:30:26 UTC
I now saw that it is not only the letter 'i', but also with most other letters 'a'-'z' and 'A'-'Z'. Exceptions seems to be 'j', 'I', 'J', 'V', and 'X', which results in expected invalid time errors.
Comment 2 Ryan Kaldari 2013-11-01 22:57:27 UTC
This is a bug in PHP. Filed a bug report:
https://bugs.php.net/bug.php?id=66018
Comment 3 Ryan Kaldari 2013-11-02 16:39:38 UTC
Actually, I was wrong. It looks like the behavior here is actually correct, as strange as that may seem. See comments at https://bugs.php.net/bug.php?id=66018.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links