PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / 2.5.0
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution v2.5.0
2.5.0 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 All 34 releases
← All changes | app/Services/LocationService.php +39 -0 2.4.0 → 2.5.0 View file →
@@ -225,5 +225,44 @@
225 225 }
226 226 }
227 227 return $locationOptions;
228 228 }
229 +
230 + public static function sanitizePublicLocationSettings($locationSettings)
231 + {
232 + if (!is_array($locationSettings)) {
233 + return [];
234 + }
235 +
236 + $safe = [];
237 + foreach ($locationSettings as $location) {
238 + if (!is_array($location)) {
239 + continue;
240 + }
241 +
242 + $type = Arr::get($location, 'type');
243 + $displayOnBooking = Arr::get($location, 'display_on_booking') === 'yes';
244 +
245 + $sanitized = [
246 + 'type' => $type,
247 + 'title' => Arr::get($location, 'title'),
248 + 'display_on_booking' => Arr::get($location, 'display_on_booking', 'no'),
249 + ];
250 +
251 + // Only expose host-private fields when the host explicitly opted
252 + // in to display them before booking.
253 + if ($displayOnBooking) {
254 + if ($type === 'online_meeting') {
255 + $sanitized['meeting_link'] = Arr::get($location, 'meeting_link');
256 + } elseif ($type === 'phone_organizer') {
257 + $sanitized['host_phone_number'] = Arr::get($location, 'host_phone_number');
258 + } elseif (in_array($type, ['in_person_organizer', 'custom'], true)) {
259 + $sanitized['description'] = Arr::get($location, 'description');
260 + }
261 + }
262 +
263 + $safe[] = $sanitized;
264 + }
265 +
266 + return $safe;
267 + }
229 268 }