Homec4science

Force date/time preferences to valid values

Authored by epriestley <git@epriestley.com> on Jun 19 2015, 00:11.

Description

Force date/time preferences to valid values

Summary:
Fixes T8601. To reproduce the problem:

  • Set your time preference to "" (the empty string). This isn't possible from the modern UI, but can be done with "Right Click > Inspect Element", or users may have carried it forward from an older setting (this is the case with me and @hach-que on this install).
  • Load Calendar with some events.
  • This parses an epoch, which sets valueTime to "" (since there are no format characters in the preference) and then getEpoch() fails because strlen($time) is 0.
  • Since getEpoch() failed, getDateTime() also fails.

To fix this:

  • Only permit the date and time preferences to have valid values.

Test Plan:

  • Loaded page before patch, saw fatal.
  • Applied patch.
  • No more fatal.
  • Viewed tooltips, dates/times, dates/times in other apps.
  • Changed my preferences, saw them respected.

Reviewers: lpriestley

Reviewed By: lpriestley

Subscribers: epriestley, hach-que

Maniphest Tasks: T8601

Differential Revision: https://secure.phabricator.com/D13346

Details

Committed
epriestley <git@epriestley.com>Jun 19 2015, 00:11
Pushed
aubortJan 31 2017, 17:16
Parents
rPHe96cd29efff7: Reduce badness in viewing large files in the Diffusion web UI
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHb12f13efd8d0: Force date/time preferences to valid values (authored by epriestley <git@epriestley.com>).Jun 19 2015, 00:11