Skip to content

Commit

Permalink
Protect against null value for these date fields.
Browse files Browse the repository at this point in the history
Potentially fixes broken date values being sent to EAS clients,
thus breaking sync.
  • Loading branch information
mrubinsk committed Jan 15, 2018
1 parent 593c228 commit e145146
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -1491,21 +1491,27 @@ public function toASTask(array $options = array())

/* Completion */
if ($this->completed) {
$message->datecompleted = new Horde_Date($this->completed_date);
if ($this->completed_date) {
$message->datecompleted = new Horde_Date($this->completed_date);
}
$message->complete = Horde_ActiveSync_Message_Task::TASK_COMPLETE_TRUE;
} else {
$message->complete = Horde_ActiveSync_Message_Task::TASK_COMPLETE_FALSE;
}

/* Due Date */
if (!empty($this->due)) {
$message->utcduedate = new Horde_Date($this->due);
if ($this->due) {
$message->utcduedate = new Horde_Date($this->due);
}
$message->duedate = clone($message->utcduedate);
}

/* Start Date */
if (!empty($this->start)) {
$message->utcstartdate = new Horde_Date($this->start);
if ($this->start) {
$message->utcstartdate = new Horde_Date($this->start);
}
$message->startdate = clone($message->utcstartdate);
}

Expand Down

0 comments on commit e145146

Please sign in to comment.