From 2d391298fb048f3fc36a52859c212344f04b6a35 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Wed, 30 Nov 2011 20:58:27 +0100 Subject: [PATCH 1/3] Contacts: Allow '/' in property name Kaddressbook uses this in the messaging property. This is allowed in Version 2 of the vcard specification. Version 3 of the specification doesn't allow this any more but be lenient in what we accept. --- 3rdparty/Sabre/VObject/Reader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/Sabre/VObject/Reader.php b/3rdparty/Sabre/VObject/Reader.php index 5ed7882ac9..7d1c282838 100644 --- a/3rdparty/Sabre/VObject/Reader.php +++ b/3rdparty/Sabre/VObject/Reader.php @@ -117,7 +117,7 @@ class Sabre_VObject_Reader { //$result = preg_match('/(?P[A-Z0-9-]+)(?:;(?P^(?([^:^\"]|\"([^\"]*)\")*))?"; $regex = "/^(?P$token)$parameters:(?P.*)$/i"; From e5fdc6013a05268b5b61008ed420cacc0a9d0422 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Wed, 30 Nov 2011 21:08:42 +0100 Subject: [PATCH 2/3] Calendar: Use the default timezone that is set in lib/base.php --- apps/calendar/ajax/events.php | 2 +- apps/calendar/ajax/neweventform.php | 2 +- apps/calendar/lib/object.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php index 9a2ba88060..1ef6bd3059 100644 --- a/apps/calendar/ajax/events.php +++ b/apps/calendar/ajax/events.php @@ -30,7 +30,7 @@ $start = DateTime::createFromFormat('U', $_GET['start']); $end = DateTime::createFromFormat('U', $_GET['end']); $events = OC_Calendar_Object::allInPeriod($_GET['calendar_id'], $start, $end); -$user_timezone = OC_Preferences::getValue(OC_USER::getUser(), "calendar", "timezone", "Europe/London"); +$user_timezone = OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); $return = array(); foreach($events as $event){ $object = OC_Calendar_Object::parse($event['calendardata']); diff --git a/apps/calendar/ajax/neweventform.php b/apps/calendar/ajax/neweventform.php index 588d364871..68423adb34 100644 --- a/apps/calendar/ajax/neweventform.php +++ b/apps/calendar/ajax/neweventform.php @@ -29,7 +29,7 @@ if (!$end){ } $start = new DateTime('@'.$start); $end = new DateTime('@'.$end); -$timezone = OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone', 'Europe/London'); +$timezone = OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); $start->setTimezone(new DateTimeZone($timezone)); $end->setTimezone(new DateTimeZone($timezone)); diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php index 58d46ce6a7..770df8b63d 100644 --- a/apps/calendar/lib/object.php +++ b/apps/calendar/lib/object.php @@ -528,7 +528,7 @@ class OC_Calendar_Object{ $dtstart->setDateTime($start, Sabre_VObject_Element_DateTime::DATE); $dtend->setDateTime($end, Sabre_VObject_Element_DateTime::DATE); }else{ - $timezone = OC_Preferences::getValue(OC_USER::getUser(), "calendar", "timezone", "Europe/London"); + $timezone = OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); $timezone = new DateTimeZone($timezone); $start = new DateTime($from.' '.$fromtime, $timezone); $end = new DateTime($to.' '.$totime, $timezone); From 0bbeb13e260caf97cb1029c66482101e839e6f32 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Wed, 30 Nov 2011 21:13:26 +0100 Subject: [PATCH 3/3] Calendar: Also check if the enddate is in the requested range for events --- apps/calendar/lib/object.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php index 770df8b63d..b016469042 100644 --- a/apps/calendar/lib/object.php +++ b/apps/calendar/lib/object.php @@ -43,10 +43,12 @@ class OC_Calendar_Object{ public static function allInPeriod($id, $start, $end){ $stmt = OC_DB::prepare( 'SELECT * FROM *PREFIX*calendar_objects WHERE calendarid = ?' .' AND ((startdate >= ? AND startdate <= ? AND repeating = 0)' + .' OR (enddate >= ? AND enddate <= ? AND repeating = 0)' .' OR (startdate <= ? AND repeating = 1))' ); $start = self::getUTCforMDB($start); $end = self::getUTCforMDB($end); $result = $stmt->execute(array($id, + $start, $end, $start, $end, $end));