[Pkg-owncloud-commits] [php-sabre-vobject] 49/65: Fixes issue with #168 in Free/Busy Generator

David Prévot taffit at moszumanska.debian.org
Tue Feb 24 23:57:19 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabre-vobject.

commit 88561971bc37f031828ec43c3254d227ba1d5c31
Author: Martin Porcheron <martin at porcheron.io>
Date:   Thu Feb 12 11:30:04 2015 +0000

    Fixes issue with #168 in Free/Busy Generator
---
 lib/FreeBusyGenerator.php | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/lib/FreeBusyGenerator.php b/lib/FreeBusyGenerator.php
index 406e62a..c1c4541 100644
--- a/lib/FreeBusyGenerator.php
+++ b/lib/FreeBusyGenerator.php
@@ -5,6 +5,7 @@ namespace Sabre\VObject;
 use DateTimeZone;
 use Sabre\VObject\Component\VCalendar;
 use Sabre\VObject\Recur\EventIterator;
+use Sabre\VObject\Recur\NoInstancesException;
 
 /**
  * This class helps with generating FREEBUSY reports based on existing sets of
@@ -179,7 +180,7 @@ class FreeBusyGenerator {
 
         $busyTimes = array();
 
-        foreach($this->objects as $object) {
+        foreach($this->objects as $key=>$object) {
 
             foreach($object->getBaseComponents() as $component) {
 
@@ -204,8 +205,16 @@ class FreeBusyGenerator {
                         $times = array();
 
                         if ($component->RRULE) {
+                            try {
+                                $iterator = new EventIterator($object, (string)$component->uid, $this->timeZone);
+                            } catch (NoInstancesException $e) {
+                                // This event is recurring, but it doesn't have a single
+                                // instance. We are skipping this event from the output
+                                // entirely.
+                                unset($this->objects[$key]);
+                                continue;
+                            }
 
-                            $iterator = new EventIterator($object, (string)$component->uid, $this->timeZone);
                             if ($this->start) {
                                 $iterator->fastForward($this->start);
                             }
@@ -352,4 +361,3 @@ class FreeBusyGenerator {
     }
 
 }
-

-- 
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