Recurrence messages can only contain a recur_end OR a recur_count, not both.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 22 Jun 2010 05:01:36 +0000 (01:01 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 22 Jun 2010 05:01:36 +0000 (01:01 -0400)
framework/ActiveSync/lib/Horde/ActiveSync/Message/Appointment.php

index c8ac8d2..94278f4 100644 (file)
@@ -389,8 +389,13 @@ class Horde_ActiveSync_Message_Appointment extends Horde_ActiveSync_Message_Base
         if (!empty($recurrence->recurInterval)) {
             $r->interval = $recurrence->recurInterval;
         }
-        $r->until = $recurrence->getRecurEnd();
-        $r->occurrences = $recurrence->getRecurCount();
+
+        /* AS messages can only have one or the other, not both */
+        if ($recurrence->hasRecurCount()) {
+            $r->occurrences = $recurrence->getRecurCount();
+        } else {
+            $r->until = $recurrence->getRecurEnd();
+        }
 
         $this->_properties['recurrence'] = $r;
     }