Page MenuHomePhabricator

Force date/time preferences to valid values
ClosedPublic

Authored by epriestley on Jun 18 2015, 7:14 PM.
Tags
None
Referenced Files
F19800413: D13346.id32290.diff
Feb 28 2026, 3:13 PM
F19789657: D13346.diff
Feb 25 2026, 6:04 PM
F19786455: D13346.id32297.diff
Feb 25 2026, 9:16 AM
F19780069: D13346.id.diff
Feb 23 2026, 6:41 PM
F19713805: D13346.id32290.diff
Feb 12 2026, 12:06 AM
F19704385: D13346.id32290.diff
Feb 11 2026, 4:11 AM
F19704369: D13346.id32290.diff
Feb 11 2026, 4:10 AM
F19675434: D13346.id.diff
Feb 8 2026, 9:45 AM

Details

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.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Force date/time preferences to valid values.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: lpriestley.
epriestley added a subscriber: hach-que.
lpriestley edited edge metadata.
This revision is now accepted and ready to land.Jun 18 2015, 10:04 PM
This revision was automatically updated to reflect the committed changes.