Jake B.
Well-known member
- Affected version
- 2.0.11 / 2.1.0 Beta 4 (probably 1.X as well, but haven't tested there)
I'm pulling in a user's timezone from an OAuth provider, and this provider supports aliases (Asia/Calcutta for example, which is an alias to Asia/Kolkata). I think this is because XenForo uses
\DateTimeZone::listIdentifiers()
to get a list of timezones and compares to that which doesn't contain some aliases/"legacy" timezones. If you check the validity of the timezone using something like this to get support for these aliases (I see you have a specific check for Asia/Yangon, which is likely a similar situation to how Asia/Calcutta behaves)
PHP:
function isValidTimezone($timeZone)
{
try {
new \DateTimeZone($tzString);
return true
} catch (\Exception $e) {
return false
}
}