diff --git a/lib/Model/Contact.php b/lib/Model/Contact.php index 12f2535..fe9621a 100644 --- a/lib/Model/Contact.php +++ b/lib/Model/Contact.php @@ -301,7 +301,7 @@ public function jsonSerialize() { $result["addresses"] = $this->addresses; } if (!is_null($this->birthdate)) { - $result["birthdate"] = Json::packTimestamp($this->birthdate); + $result["birthdate"] = !empty($this->birthdate) ? Json::packTimestamp($this->birthdate) : null; } if (!is_null($this->company)) { $result["company"] = strval($this->company); diff --git a/lib/Request.php b/lib/Request.php index dcb91e1..8c21bab 100644 --- a/lib/Request.php +++ b/lib/Request.php @@ -163,9 +163,7 @@ private function prepare() { $headers[] = "Expect:"; // issue with cURL when doing big size POSTs https://stackoverflow.com/questions/14158675/how-can-i-stop-curl-from-using-100-continue if ($this->bodycontenttype == "json") { foreach ($this->body as $key => $value) { - if (!is_null($value)) { - $body[$key] = $value; - } + $body[$key] = $value; } $body = json_encode($body); $headers[] = "Content-Type: application/json";