diff options
author | Thomas Willingham <founder@kakste.com> | 2014-04-12 18:13:37 +0100 |
---|---|---|
committer | Thomas Willingham <founder@kakste.com> | 2014-04-12 18:13:37 +0100 |
commit | cdc8454cf112006e4199b6221bcaa3c3a509b564 (patch) | |
tree | 267293b7f5536bda899324af8913549baf4c4c72 /vendor/sabre/vobject/lib | |
parent | 2fdcd0c27eac389709f48d6b40723e153c1492e6 (diff) | |
download | volse-hubzilla-cdc8454cf112006e4199b6221bcaa3c3a509b564.tar.gz volse-hubzilla-cdc8454cf112006e4199b6221bcaa3c3a509b564.tar.bz2 volse-hubzilla-cdc8454cf112006e4199b6221bcaa3c3a509b564.zip |
Update sabre
Diffstat (limited to 'vendor/sabre/vobject/lib')
-rw-r--r-- | vendor/sabre/vobject/lib/Sabre/VObject/TimeZoneUtil.php | 59 | ||||
-rw-r--r-- | vendor/sabre/vobject/lib/Sabre/VObject/Version.php | 2 |
2 files changed, 53 insertions, 8 deletions
diff --git a/vendor/sabre/vobject/lib/Sabre/VObject/TimeZoneUtil.php b/vendor/sabre/vobject/lib/Sabre/VObject/TimeZoneUtil.php index 6f5b69f3f..c009a6af0 100644 --- a/vendor/sabre/vobject/lib/Sabre/VObject/TimeZoneUtil.php +++ b/vendor/sabre/vobject/lib/Sabre/VObject/TimeZoneUtil.php @@ -298,6 +298,36 @@ class TimeZoneUtil { 'Fiji' => 'Pacific/Fiji', 'New Zealand' => 'Pacific/Auckland', 'Tonga' => 'Pacific/Tongatapu', + + // PHP 5.5.10 failed on a few timezones that were valid before. We're + // normalizing them here. + 'CST6CDT' => 'America/Chicago', + 'Cuba' => 'America/Havana', + 'Egypt' => 'Africa/Cairo', + 'Eire' => 'Europe/Dublin', + 'EST5EDT' => 'America/New_York', + 'Factory' => 'UTC', + 'GB-Eire' => 'Europe/London', + 'GMT0' => 'UTC', + 'Greenwich' => 'UTC', + 'Hongkong' => 'Asia/Hong_Kong', + 'Iceland' => 'Atlantic/Reykjavik', + 'Iran' => 'Asia/Tehran', + 'Israel' => 'Asia/Jerusalem', + 'Jamaica' => 'America/Jamaica', + 'Japan' => 'Asia/Tokyo', + 'Kwajalein' => 'Pacific/Kwajalein', + 'Libya' => 'Africa/Tripoli', + 'MST7MDT' => 'America/Denver', + 'Navajo' => 'America/Denver', + 'NZ-CHAT' => 'Pacific/Chatham', + 'Poland' => 'Europe/Warsaw', + 'Portugal' => 'Europe/Lisbon', + 'PST8PDT' => 'America/Los_Angeles', + 'Singapore' => 'Asia/Singapore', + 'Turkey' => 'Europe/Istanbul', + 'Universal' => 'UTC', + 'W-SU' => 'Europe/Moscow', ); /** @@ -408,9 +438,21 @@ class TimeZoneUtil { static public function getTimeZone($tzid, Component $vcalendar = null, $failIfUncertain = false) { // First we will just see if the tzid is a support timezone identifier. - try { - return new \DateTimeZone($tzid); - } catch (\Exception $e) { + // + // The only exception is if the timezone starts with (. This is to + // handle cases where certain microsoft products generate timezone + // identifiers that for instance look like: + // + // (GMT+01.00) Sarajevo/Warsaw/Zagreb + // + // Since PHP 5.5.10, the first bit will be used as the timezone and + // this method will return just GMT+01:00. This is wrong, because it + // doesn't take DST into account. + if ($tzid[0]!=='(') { + try { + return new \DateTimeZone($tzid); + } catch (\Exception $e) { + } } // Next, we check if the tzid is somewhere in our tzid map. @@ -420,6 +462,12 @@ class TimeZoneUtil { // Maybe the author was hyper-lazy and just included an offset. We // support it, but we aren't happy about it. + // + // Note that the path in the source will never be taken from PHP 5.5.10 + // onwards. PHP 5.5.10 supports the "GMT+0100" style of format, so it + // already gets returned early in this function. Once we drop support + // for versions under PHP 5.5.10, this bit can be taken out of the + // source. if (preg_match('/^GMT(\+|-)([0-9]{4})$/', $tzid, $matches)) { return new \DateTimeZone('Etc/GMT' . $matches[1] . ltrim(substr($matches[2],0,2),'0')); } @@ -443,10 +491,7 @@ class TimeZoneUtil { $lic = substr($lic,8); } - try { - return new \DateTimeZone($lic); - } catch (\Exception $e) { - } + return self::getTimeZone($lic, null, $failIfUncertain); } // Microsoft may add a magic number, which we also have an diff --git a/vendor/sabre/vobject/lib/Sabre/VObject/Version.php b/vendor/sabre/vobject/lib/Sabre/VObject/Version.php index 2a64140f4..5b04d0b7a 100644 --- a/vendor/sabre/vobject/lib/Sabre/VObject/Version.php +++ b/vendor/sabre/vobject/lib/Sabre/VObject/Version.php @@ -14,7 +14,7 @@ class Version { /** * Full version number */ - const VERSION = '2.1.3'; + const VERSION = '2.1.4'; /** * Stability : alpha, beta, stable |