[Pkg-owncloud-commits] [php-sabre-vobject] 43/65: use existing $exdate-array for the $significantChangeHash to have them all sorted

David Prévot taffit at moszumanska.debian.org
Tue Feb 24 23:57:17 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 d13f4326e123130275d2111898dcf23782731058
Author: Armin Hackmann <armin at fruux.com>
Date:   Thu Feb 5 15:34:15 2015 +0100

    use existing $exdate-array for the $significantChangeHash to have them all sorted
---
 lib/ITip/Broker.php                          | 18 +++++++++++-------
 tests/VObject/ITip/BrokerUpdateEventTest.php |  8 ++++----
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/lib/ITip/Broker.php b/lib/ITip/Broker.php
index f60f514..4649852 100644
--- a/lib/ITip/Broker.php
+++ b/lib/ITip/Broker.php
@@ -916,15 +916,19 @@ class Broker {
             foreach($this->significantChangeProperties as $prop) {
                 if (isset($vevent->$prop)) {
                     $propertyValues = $vevent->select($prop);
-                    if ($prop === 'EXDATE') {
-                        usort($propertyValues, function($a, $b) {
-                            return strcmp($a->getValue(), $b->getValue());
-                        });
-                    }
 
                     $significantChangeHash.=$prop.':';
-                    foreach($propertyValues as $val) {
-                        $significantChangeHash.= $val->getValue().';';
+
+                    if ($prop === 'EXDATE') {
+
+                        $significantChangeHash.= implode($exdate, ',').';';
+
+                    } else {
+
+                        foreach($propertyValues as $val) {
+                            $significantChangeHash.= $val->getValue().';';
+                        }
+
                     }
                 }
             }
diff --git a/tests/VObject/ITip/BrokerUpdateEventTest.php b/tests/VObject/ITip/BrokerUpdateEventTest.php
index e285978..3ba6a11 100644
--- a/tests/VObject/ITip/BrokerUpdateEventTest.php
+++ b/tests/VObject/ITip/BrokerUpdateEventTest.php
@@ -737,8 +737,8 @@ SUMMARY:foo
 DTSTART:20141211T160000Z
 DTEND:20141211T170000Z
 RRULE:FREQ=WEEKLY
-EXDATE:20141225T160000Z
-EXDATE:20150101T160000Z
+EXDATE:20141225T160000Z,20150101T160000Z
+EXDATE:20150108T160000Z
 END:VEVENT
 END:VCALENDAR
 ICS;
@@ -761,7 +761,7 @@ DTSTART:20141211T160000Z
 DTEND:20141211T170000Z
 RRULE:FREQ=WEEKLY
 EXDATE:20150101T160000Z
-EXDATE:20141225T160000Z
+EXDATE:20150108T160000Z,20141225T160000Z
 END:VEVENT
 END:VCALENDAR
 ICS;
@@ -796,7 +796,7 @@ DTSTART:20141211T160000Z
 DTEND:20141211T170000Z
 RRULE:FREQ=WEEKLY
 EXDATE:20150101T160000Z
-EXDATE:20141225T160000Z
+EXDATE:20150108T160000Z,20141225T160000Z
 END:VEVENT
 END:VCALENDAR
 ICS

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