From 59170af99707583e69d4dc655806fa25bc2e93fd Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Sat, 14 Jan 2023 10:08:06 +0100 Subject: [PATCH] Adjust manage mode handling in booking page --- application/controllers/Booking.php | 2 +- assets/js/http/booking_http_client.js | 2 +- assets/js/pages/booking.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/controllers/Booking.php b/application/controllers/Booking.php index dc3852e5..55094b05 100755 --- a/application/controllers/Booking.php +++ b/application/controllers/Booking.php @@ -422,7 +422,7 @@ class Booking extends EA_Controller { $captcha = request('captcha'); $appointment = $post_data['appointment']; $customer = $post_data['customer']; - $manage_mode = isset($post_data['manage_mode']) && $post_data['manage_mode']; + $manage_mode = filter_var($post_data['manage_mode'], FILTER_VALIDATE_BOOLEAN); if ( ! array_key_exists('address', $customer)) { diff --git a/assets/js/http/booking_http_client.js b/assets/js/http/booking_http_client.js index d4b46f9e..094e5fcb 100755 --- a/assets/js/http/booking_http_client.js +++ b/assets/js/http/booking_http_client.js @@ -247,7 +247,7 @@ App.Http.Booking = (function () { service_id: serviceId, selected_date: encodeURIComponent(selectedDateString), csrf_token: vars('csrf_token'), - manage_mode: App.Pages.Booking.manageMode, + manage_mode: Number(App.Pages.Booking.manageMode), appointment_id: appointmentId }; diff --git a/assets/js/pages/booking.js b/assets/js/pages/booking.js index 943c9d66..8a5314ba 100644 --- a/assets/js/pages/booking.js +++ b/assets/js/pages/booking.js @@ -719,7 +719,7 @@ App.Pages.Booking = (function () { id_services: $selectService.val() }; - data.manage_mode = manageMode; + data.manage_mode = Number(manageMode); if (manageMode) { data.appointment.id = vars('appointment_data').id;