From: Michael J. Rubinsky Date: Thu, 12 Nov 2009 20:46:00 +0000 (-0500) Subject: Need to consistently key events by string, not by integer, otherwise X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c30b152c027c0b0727f8a7f43b5d1a2490653e21;p=horde.git Need to consistently key events by string, not by integer, otherwise when the results are JSON encoded we may get an object or an array. --- diff --git a/kronolith/lib/Driver/Ical.php b/kronolith/lib/Driver/Ical.php index 9f8440bb5..0719df3a5 100644 --- a/kronolith/lib/Driver/Ical.php +++ b/kronolith/lib/Driver/Ical.php @@ -79,16 +79,14 @@ class Kronolith_Driver_Ical extends Kronolith_Driver $components = $iCal->getComponents(); $events = array(); - $count = count($components); $exceptions = array(); - for ($i = 0; $i < $count; $i++) { - $component = $components[$i]; + foreach ($components as $component) { if ($component->getType() == 'vEvent') { $event = new Kronolith_Event_Ical($this); $event->status = Kronolith::STATUS_FREE; $event->fromiCalendar($component); $event->remoteCal = $this->_calendar; - $event->eventID = $i; + $event->eventID = hash('md5', uniqid(mt_rand(), true)); /* Catch RECURRENCE-ID attributes which mark single recurrence * instances. */