SpecialLog: Don't throw exceptions on invalid date from user input
authorKunal Mehta <legoktm@member.fsf.org>
Sun, 23 Sep 2018 18:58:14 +0000 (11:58 -0700)
committerJames D. Forrester <jforrester@wikimedia.org>
Mon, 24 Sep 2018 15:56:48 +0000 (08:56 -0700)
commitf198154d767824e3ade13e39774f20641917674e
tree678c1d9fc3bda48bbbcfe62bb71e3fafe4e56759
parent2edd34a881e90fb8307d055e817f3ef0c2cfc6bb
SpecialLog: Don't throw exceptions on invalid date from user input

If users provide invalid input to the date option on Special:Log (most likely
an intentional thing given the calendar input widget), don't let the
TimestampException bubble up - just discard the invalid date.

Integration test included, which fails without this patch.

Bug: T201411
Change-Id: Ie1a9a84343ae4e78e076586f759917e5fd5af33c
includes/specials/SpecialLog.php
tests/phpunit/includes/specials/SpecialLogTest.php [new file with mode: 0644]