diff --git a/lib/kolab_sync_timezone_converter.php b/lib/kolab_sync_timezone_converter.php --- a/lib/kolab_sync_timezone_converter.php +++ b/lib/kolab_sync_timezone_converter.php @@ -57,6 +57,14 @@ ) ); + + protected $_legacyTimezones = array( + # This is an outdated timezone that outlook keeps sending because of an outdate timezone database on windows + 'Lv///0kAcgBhAG4AIABTAHQAYQBuAGQAYQByAGQAIABUAGkAbQBlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkABAADABcAOwA7AOcDAAAAAEkAcgBhAG4AIABEAGEAeQBsAGkAZwBoAHQAIABUAGkAbQBlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAwAEAAAAAAAAAAAAxP///w==' => array( + 'Asia/Tehran' => '+0330' + ) + ); + /** * don't use the constructor. Use the singleton. * @@ -140,6 +148,9 @@ if (is_string($_offsets) && isset($this->_knownTimezones[$_offsets])) { $timezones = $this->_knownTimezones[$_offsets]; } + elseif (is_string($_offsets) && isset($this->_legacyTimezones[$_offsets])) { + $timezones = $this->_legacyTimezones[$_offsets]; + } else { if (is_string($_offsets)) { // unpack timezone info to array diff --git a/tests/timezone_converter.php b/tests/timezone_converter.php --- a/tests/timezone_converter.php +++ b/tests/timezone_converter.php @@ -29,6 +29,13 @@ $this->assertTrue(is_array($output)); $this->assertTrue(isset($output['Asia/Tehran'])); + + # As seen in outlook + $converter = kolab_sync_timezone_converter::getInstance(); + $output = $converter->getListOfTimezones('Lv///0kAcgBhAG4AIABTAHQAYQBuAGQAYQByAGQAIABUAGkAbQBlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkABAADABcAOwA7AOcDAAAAAEkAcgBhAG4AIABEAGEAeQBsAGkAZwBoAHQAIABUAGkAbQBlAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAwAEAAAAAAAAAAAAxP///w=='); + + $this->assertTrue(is_array($output)); + $this->assertTrue(isset($output['Asia/Tehran'])); } function data_get_timezone()