From fff57ad3f3a79f94f40fd2b9641c2d4d82c0c05f Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Tue, 24 Mar 2020 18:54:50 +0100 Subject: [PATCH] Ensure that only valid appointments are being processed. --- application/controllers/Appointments.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/application/controllers/Appointments.php b/application/controllers/Appointments.php index 04401f60..5d3df41f 100755 --- a/application/controllers/Appointments.php +++ b/application/controllers/Appointments.php @@ -926,6 +926,11 @@ class Appointments extends CI_Controller { { $appointment_start = new DateTime($provider_appointment['start_datetime']); $appointment_end = new DateTime($provider_appointment['end_datetime']); + + if ($appointment_start >= $appointment_end) { + continue; + } + $period_start = new DateTime($selected_date . ' ' . $period['start']); $period_end = new DateTime($selected_date . ' ' . $period['end']);