Reject out-of-range output when converting to TS_MW
authorBrad Jorsch <bjorsch@wikimedia.org>
Fri, 19 Dec 2014 22:06:38 +0000 (17:06 -0500)
committerBrad Jorsch <bjorsch@wikimedia.org>
Fri, 19 Dec 2014 22:06:38 +0000 (17:06 -0500)
commite27ff73b3221a977639de1bd18c8bbb0ed78805c
treeeb5e4a486cc5215087b81562e74d3973004bd501
parent9403293b246890fa6166962a11757c75fcd1072a
Reject out-of-range output when converting to TS_MW

TS_MW is a 14-character string "YYYYMMDDHHIISS", and thus cannot
represent timestamps earlier than 00000101000000 or later than
99991231235959.

MWTimestamp should throw an exception if asked to represent out-of-range
times in this format, rather than returning invalid values that are
likely to be truncated by the database.

Bug: T51580
Change-Id: I744e446356f3ed9193dfaaaec5dc81c611dab4a3
includes/MWTimestamp.php
tests/phpunit/includes/MWTimestampTest.php