From 7713f3ffa629a31f336bf1ccb81e7b70ce0bdb00 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Tue, 21 May 2024 15:22:40 +0200 Subject: [PATCH] Add empty value check (#1529) --- application/models/Providers_model.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/application/models/Providers_model.php b/application/models/Providers_model.php index 4a9eb1b1..b3ff051e 100755 --- a/application/models/Providers_model.php +++ b/application/models/Providers_model.php @@ -524,6 +524,13 @@ class Providers_model extends EA_Model array $working_plan_exception = null, ): void { // Validate the working plan exception data. + + if (empty($working_plan_exception['start']) || empty($working_plan_exception['end'])) { + throw new InvalidArgumentException( + 'Empty start and/or end time provided: ' . json_encode($working_plan_exception), + ); + } + $start = date('H:i', strtotime($working_plan_exception['start'])); $end = date('H:i', strtotime($working_plan_exception['end']));