Proper handling of invalid/unknown time zones
authorThis, that and the other <at.light@live.com.au>
Sun, 25 Dec 2016 04:55:11 +0000 (15:55 +1100)
committerTTO <at.light@live.com.au>
Thu, 5 Jan 2017 05:24:45 +0000 (05:24 +0000)
commit2b2cda890b86dad6c78584039d65fcecf9bd69b7
tree762a4047ff14a16daf2a62cc04c36b19d51f7565
parent226b84f31bdc4b4a1fd17542d78fb3f5013b1aca
Proper handling of invalid/unknown time zones

Currently, a user who has an invalid time zone stored in the database is
effectively locked out of their account on HHVM sites. This patch addresses
this by (1) preventing users from setting invalid time zones, and (2) not
throwing an unhandled exception if a user's TZ is unknown.

When the user saves their preferences, the code silently rewrites invalid
time zones to UTC. I think this is OK, since to cause this to happen you
have to manually muck around with the Preferences page DOM or submit the
form from a script.

Bug: T137182
Change-Id: I28c5e2ac9f2e681718c6080fb49b3b01e4af46dd
includes/Preferences.php
languages/Language.php