PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / trunk
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution vtrunk
2.4.0 2.3.0 2.2.5 2.2.0 2.1.2 2.1.1 trunk 1.10.0 1.10.01 1.10.02 1.5.0 1.5.01 1.5.02 1.5.1 1.5.10 1.5.20 1.5.21 1.5.22 1.5.23 1.5.24 1.5.25 1.6.0 1.7.0 1.7.1 1.7.2 All 33 releases
← All changes | app/Http/Controllers/BookingController.php +11 -1 2.3.0trunk View file →
@@ -313,9 +313,19 @@
313 313
314 314 $duration = $calendarEvent->getDuration($request->get('duration'));
315 315
316 316 $hostId = $request->get('host_id', null);
317 -
317 +
318 + if ($hostId) {
319 + $hostId = (int) $hostId;
320 +
321 + if (!in_array($hostId, array_map('intval', $calendarEvent->getHostIds()), true)) {
322 + wp_send_json([
323 + 'message' => __('The selected host is not a host of this event', 'fluent-booking')
324 + ], 422);
325 + }
326 + }
327 +
318 328 $timeSlotService = TimeSlotServiceHandler::initService($calendar, $calendarEvent);
319 329
320 330 if (is_wp_error($timeSlotService)) {
321 331 return TimeSlotServiceHandler::sendError($timeSlotService, $calendarEvent, $timeZone);