[Pkg-owncloud-commits] [php-sabre-vobject] 01/06: Fixed undefined index 'foo at bar.com' notices.

David Prévot taffit at moszumanska.debian.org
Wed May 27 21:37:01 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 8172f0e64a9b87e2e2acd520623576344cce7993
Author: Evert Pot <me at evertpot.com>
Date:   Fri May 22 16:24:55 2015 +0300

    Fixed undefined index 'foo at bar.com' notices.
---
 ChangeLog.md                                   |  7 ++
 lib/ITip/Broker.php                            |  6 +-
 tests/VObject/ITip/BrokerAttendeeReplyTest.php | 93 ++++++++++++++++++++++++++
 3 files changed, 105 insertions(+), 1 deletion(-)

diff --git a/ChangeLog.md b/ChangeLog.md
index b884d0e..78d9205 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,6 +1,13 @@
 ChangeLog
 =========
 
+3.4.4 (????-??-??)
+------------------
+
+* #???: Fixed a 'party crasher' bug in the iTip broker. This would break
+  scheduling in some cases.
+
+
 3.4.3 (2015-05-19)
 ------------------
 
diff --git a/lib/ITip/Broker.php b/lib/ITip/Broker.php
index 23ae4d7..5dada56 100644
--- a/lib/ITip/Broker.php
+++ b/lib/ITip/Broker.php
@@ -642,8 +642,12 @@ class Broker {
             return array();
         }
 
+        $oldInstances = !empty($oldEventInfo['attendees'][$attendee]['instances']) ?
+            $oldEventInfo['attendees'][$attendee]['instances'] :
+            array();
+
         $instances = array();
-        foreach($oldEventInfo['attendees'][$attendee]['instances'] as $instance) {
+        foreach($oldInstances as $instance) {
 
             $instances[$instance['id']] = array(
                 'id' => $instance['id'],
diff --git a/tests/VObject/ITip/BrokerAttendeeReplyTest.php b/tests/VObject/ITip/BrokerAttendeeReplyTest.php
index fd873fe..6fb0367 100644
--- a/tests/VObject/ITip/BrokerAttendeeReplyTest.php
+++ b/tests/VObject/ITip/BrokerAttendeeReplyTest.php
@@ -1034,4 +1034,97 @@ ICS
         $result = $this->parse($oldMessage, $newMessage, $expected);
 
     }
+
+    /**
+     * A party crasher is an attendee that accepted an event, but was not in
+     * any original invite.
+     *
+     * @depends testAccepted
+     */
+    function testPartyCrasher() {
+
+        $oldMessage = <<<ICS
+BEGIN:VCALENDAR
+VERSION:2.0
+BEGIN:VEVENT
+UID:foobar
+SUMMARY:B-day party
+SEQUENCE:1
+ORGANIZER;CN=Strunk:mailto:strunk at example.org
+DTSTART:20140716T120000Z
+RRULE:FREQ=DAILY
+END:VEVENT
+BEGIN:VEVENT
+UID:foobar
+RECURRENCE-ID:20140717T120000Z
+SUMMARY:B-day party
+SEQUENCE:1
+ORGANIZER;CN=Strunk:mailto:strunk at example.org
+DTSTART:20140717T120000Z
+RRULE:FREQ=DAILY
+END:VEVENT
+END:VCALENDAR
+ICS;
+
+
+        $newMessage = <<<ICS
+BEGIN:VCALENDAR
+VERSION:2.0
+BEGIN:VEVENT
+UID:foobar
+SUMMARY:B-day party
+SEQUENCE:1
+ORGANIZER;CN=Strunk:mailto:strunk at example.org
+DTSTART:20140716T120000Z
+RRULE:FREQ=DAILY
+END:VEVENT
+BEGIN:VEVENT
+UID:foobar
+RECURRENCE-ID:20140717T120000Z
+SUMMARY:B-day party
+SEQUENCE:1
+ORGANIZER;CN=Strunk:mailto:strunk at example.org
+ATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one at example.org
+DTSTART:20140717T120000Z
+RRULE:FREQ=DAILY
+END:VEVENT
+END:VCALENDAR
+ICS;
+
+        $version = \Sabre\VObject\Version::VERSION;
+
+        $expected = array(
+            array(
+                'uid' => 'foobar',
+                'method' => 'REPLY',
+                'component' => 'VEVENT',
+                'sender' => 'mailto:one at example.org',
+                'senderName' => 'One',
+                'recipient' => 'mailto:strunk at example.org',
+                'recipientName' => 'Strunk',
+                'message' => <<<ICS
+BEGIN:VCALENDAR
+VERSION:2.0
+CALSCALE:GREGORIAN
+METHOD:REPLY
+BEGIN:VEVENT
+UID:foobar
+SEQUENCE:1
+DTSTART:20140717T120000Z
+SUMMARY:B-day party
+RECURRENCE-ID:20140717T120000Z
+ORGANIZER;CN=Strunk:mailto:strunk at example.org
+ATTENDEE;PARTSTAT=ACCEPTED;CN=One:mailto:one at example.org
+END:VEVENT
+END:VCALENDAR
+
+ICS
+
+            ),
+
+        );
+
+        $result = $this->parse($oldMessage, $newMessage, $expected);
+
+    }
 }

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