mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 03:50:54 +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:
parent
29d6e5fd4b
commit
637b58c7c8
1 changed files with 8 additions and 0 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue