Skip to content

Commit

Permalink
fix registration and termination date to flip between empty-value and…
Browse files Browse the repository at this point in the history
… 0000-00-00, thx to dxd

Signed-off-by: Michael Kaufmann <[email protected]>
  • Loading branch information
Michael Kaufmann committed Oct 17, 2019
1 parent 79056f2 commit f0b36c0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Froxlor/Api/Commands/Domains.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public function add()
'0',
''
), true);
if ($registration_date == '0000-00-00') {
if ($registration_date == '0000-00-00' || empty($registration_date)) {
$registration_date = null;
}

Expand All @@ -301,7 +301,7 @@ public function add()
'0',
''
), true);
if ($termination_date == '0000-00-00') {
if ($termination_date == '0000-00-00' || empty($termination_date)) {
$termination_date = null;
}

Expand Down Expand Up @@ -929,15 +929,15 @@ public function update()
'0',
''
), true);
if ($registration_date == '0000-00-00') {
if ($registration_date == '0000-00-00' || empty($registration_date)) {
$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(
'0000-00-00',
'0',
''
), true);
if ($termination_date == '0000-00-00') {
if ($termination_date == '0000-00-00' || empty($termination_date)) {
$termination_date = null;
}

Expand Down

0 comments on commit f0b36c0

Please sign in to comment.