Page MenuHomePhabricator

MWException when setting protection date to year 9999
Open, Needs TriagePublic

Description

As niche as minor this error may be, I thought I'd put it out there that it's an error.
Steps to reproduce:

  1. Protect a page and set the expiry date of 23:59, 31 December 9999
  2. Go to Special:Preferences and change your timezone to "Europe/Paris"
  3. Visit either Special:Log or Special:RecentChanges
  4. Error pasted below appears and page is inaccessible

The workaround to fix the issue is to delete the revisions that include the date.

[072786f2b0e05af3ab057bab] /w/index.php?title=Special:Log&page=Protection+test   MWException from line 1174 of /srv/mediawiki/w/languages/Language.php: Language::sprintfDate: The timestamp 100000101005959 should have 14 characters
/srv/mediawiki/w/languages/Language.php:2451, /srv/mediawiki/w/languages/Language.php:2520, /srv/mediawiki/w/includes/logging/ProtectLogFormatter.php:219, /srv/mediawiki/w/includes/logging/ProtectLogFormatter.php:184, /srv/mediawiki/w/includes/logging/ProtectLogFormatter.php:60, /srv/mediawiki/w/includes/logging/LogFormatter.php:489, /srv/mediawiki/w/includes/logging/LogFormatter.php:464, /srv/mediawiki/w/includes/logging/LogEventsList.php:386, /srv/mediawiki/w/includes/logging/LogPager.php:418, /srv/mediawiki/w/includes/pager/IndexPager.php:611, /srv/mediawiki/w/includes/specials/SpecialLog.php:242, /srv/mediawiki/w/includes/specials/SpecialLog.php:132, /srv/mediawiki/w/includes/specialpage/SpecialPage.php:600, /srv/mediawiki/w/includes/specialpage/SpecialPageFactory.php:635, /srv/mediawiki/w/includes/MediaWiki.php:307, /srv/mediawiki/w/includes/MediaWiki.php:940, /srv/mediawiki/w/includes/MediaWiki.php:543, /srv/mediawiki/w/index.php:53, /srv/mediawiki/w/index.php:46

MediaWiki: 1.35.1
PHP: 7.3.27-1~deb10u1 (fpm-fcgi)
MariaDB: 10.4.15-MariaDB-1:10.4.15+maria~buster-log

Event Timeline

Ammarpad raised the priority of this task from Lowest to Needs Triage.EditedMar 19 2021, 5:16 AM
Ammarpad added a subscriber: Ammarpad.

Ideally, it should not be possible for a user to be able to trigger exception at will