Fixed XenForo doesn't support some timezone aliases

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
    }
}
 
Thank you for reporting this issue. It has now been resolved and we are aiming to include it in a future XF release (2.1.0 B7/RC1).

Change log:
Validate timezones including backwards compatiblity zons
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Back
Top Bottom