From 0244a22c07aeaee90465e7c5dbf38ecf49e8fc56 Mon Sep 17 00:00:00 2001 From: Vaidas Lungis Date: Mon, 24 Nov 2014 13:15:58 +0200 Subject: [PATCH] do not validate empty birthday value --- src/bb-modules/Client/Api/Admin.php | 2 +- src/bb-modules/Profile/Service.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bb-modules/Client/Api/Admin.php b/src/bb-modules/Client/Api/Admin.php index 1eea1470b..70e9c3489 100644 --- a/src/bb-modules/Client/Api/Admin.php +++ b/src/bb-modules/Client/Api/Admin.php @@ -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; diff --git a/src/bb-modules/Profile/Service.php b/src/bb-modules/Profile/Service.php index 4a2581699..d2034238f 100644 --- a/src/bb-modules/Profile/Service.php +++ b/src/bb-modules/Profile/Service.php @@ -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'];