fix registration and termination date to flip between empty-value and 0000-00-00, thx to dxd

Signed-off-by: Michael Kaufmann <michael.kaufmann@aixit.com>
This commit is contained in:
Michael Kaufmann
2019-10-17 09:35:33 +02:00
parent 79056f20ee
commit f0b36c03ad

View File

@@ -292,7 +292,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
'0', '0',
'' ''
), true); ), true);
if ($registration_date == '0000-00-00') { if ($registration_date == '0000-00-00' || empty($registration_date)) {
$registration_date = null; $registration_date = null;
} }
@@ -301,7 +301,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
'0', '0',
'' ''
), true); ), true);
if ($termination_date == '0000-00-00') { if ($termination_date == '0000-00-00' || empty($termination_date)) {
$termination_date = null; $termination_date = null;
} }
@@ -929,7 +929,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
'0', '0',
'' ''
), true); ), true);
if ($registration_date == '0000-00-00') { if ($registration_date == '0000-00-00' || empty($registration_date)) {
$registration_date = null; $registration_date = null;
} }
$termination_date = \Froxlor\Validate\Validate::validate($termination_date, 'termination_date', '/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', '', array( $termination_date = \Froxlor\Validate\Validate::validate($termination_date, 'termination_date', '/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', '', array(
@@ -937,7 +937,7 @@ class Domains extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\ResourceEn
'0', '0',
'' ''
), true); ), true);
if ($termination_date == '0000-00-00') { if ($termination_date == '0000-00-00' || empty($termination_date)) {
$termination_date = null; $termination_date = null;
} }