do not validate empty birthday value

This commit is contained in:
Vaidas Lungis committed 2014-11-24 13:15:58 +02:00
1 parent 1ba147576a
commit 0244a22c07
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -312,7 +312,7 @@ class Admin extends \Api_Abstract
$client->gender = $gender;
}
if(!is_null($birthday)) {
if (strtotime($data['birthday']) == false) {
if (strlen(trim($data['birthday'])) > 0 && strtotime($data['birthday']) == false) {
throw new \Box_Exception('Invalid birth date value');
}
$client->birthday = $birthday;
+1 -1
View File
@@ -151,7 +151,7 @@ class Service implements InjectionAwareInterface
}
if (isset($data['birthday'])) {
if (strtotime($data['birthday']) == false) {
if (strlen(trim($data['birthday'])) > 0 && strtotime($data['birthday']) == false) {
throw new \Box_Exception('Invalid birth date value');
}
$client->birthday = $data['birthday'];