[Pkg-owncloud-commits] [php-sabre-vobject] 08/18: Another fix for #87.
David Prévot
taffit at moszumanska.debian.org
Mon Mar 31 01:19:39 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch 2.1
in repository php-sabre-vobject.
commit 52fc7bdfddbd17b9cdf2be8e6dbce6fb41ef80fd
Author: Evert Pot <evert at rooftopsolutions.nl>
Date: Sun Mar 30 16:32:32 2014 -0400
Another fix for #87.
---
lib/Sabre/VObject/TimeZoneUtil.php | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/lib/Sabre/VObject/TimeZoneUtil.php b/lib/Sabre/VObject/TimeZoneUtil.php
index b00750d..cd94f02 100644
--- a/lib/Sabre/VObject/TimeZoneUtil.php
+++ b/lib/Sabre/VObject/TimeZoneUtil.php
@@ -408,9 +408,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.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabre-vobject.git
More information about the Pkg-owncloud-commits
mailing list