From 214aab8c5e71f3aaa9856579cb036fd85d6d4ca8 Mon Sep 17 00:00:00 2001 From: int2001 Date: Sat, 14 Sep 2024 15:05:41 +0000 Subject: [PATCH] Fixes issue, where browser sends an empty string instead of null --- application/models/Logbook_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index c0e19d0a9..e25664f9d 100644 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -21,7 +21,7 @@ class Logbook_model extends CI_Model { $callsign = str_replace('Ø', '0', $this->input->post('callsign')); // Join date+time $datetime = date("Y-m-d",strtotime($this->input->post('start_date')))." ". $this->input->post('start_time'); - if ($this->input->post('end_time') != null) { + if ( ($this->input->post('end_time') ?? '') != '') { $datetime_off = date("Y-m-d",strtotime($this->input->post('start_date')))." ". $this->input->post('end_time'); // if time off < time on, and time off is on 00:xx >> add 1 day (concidering start and end are between 23:00 and 00:59) // $_tmp_datetime_off = strtotime($datetime_off);