1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

Correct an issue with epoch timestamps in Conduit

Summary:
Fixes T11375. Some validation code was mishandling raw epoch timestamps.

For numeric values larger than 29999999 (e.g., 2999-12-25, christmas 2999), assume the value is a timestamp.

Test Plan: Used `maniphest.search` to query for `modifiedStart`, got a better result set and saw the `dateModified` constraint in the query.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11375

Differential Revision: https://secure.phabricator.com/D16326
This commit is contained in:
epriestley 2016-07-26 07:06:25 -07:00
parent 29d6e5fd4b
commit 637b58c7c8

View file

@ -35,6 +35,14 @@ final class PhabricatorSearchDateField
return null;
}
// If this appears to be an epoch timestamp, just return it unmodified.
// This assumes values like "2016" or "20160101" are "Ymd".
if (is_int($value) || ctype_digit($value)) {
if ((int)$value > 30000000) {
return (int)$value;
}
}
return PhabricatorTime::parseLocalTime($value, $this->getViewer());
}