MFB: kolab/issue3656 (Unable to SyncML Calendar / PHP Fatal error compareDateTime())
authorGunnar Wrobel <wrobel@temple.(none)>
Fri, 26 Feb 2010 21:53:56 +0000 (22:53 +0100)
committerGunnar Wrobel <wrobel@temple.(none)>
Fri, 26 Feb 2010 21:53:56 +0000 (22:53 +0100)
kronolith/lib/Driver/Kolab.php

index ecf93cc..4a9c4ac 100644 (file)
@@ -216,16 +216,22 @@ class Kronolith_Driver_Kolab extends Kronolith_Driver
     {
         $result = $this->synchronize();
 
-        if (is_null($startDate)) {
+        if (empty($startDate)) {
             $startDate = new Horde_Date(array('mday' => 1,
                                               'month' => 1,
                                               'year' => 0000));
         }
-        if (is_null($endDate)) {
+        if (empty($endDate)) {
             $endDate = new Horde_Date(array('mday' => 31,
                                             'month' => 12,
                                             'year' => 9999));
         }
+        if (!is_a($startDate, 'Horde_Date')) {
+            $startDate = &new Horde_Date($startDate);
+        }
+        if (!is_a($endDate, 'Horde_Date')) {
+            $endDate = &new Horde_Date($endDate);
+        }
 
         $startDate = clone $startDate;
         $startDate->hour = $startDate->min = $startDate->sec = 0;