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/Hooks/Handlers/DataExporter.php +9 -6 2.1.1 → 2.5.0 View file →
@@ -46,12 +46,8 @@
46 46 if (!$this->verifyNonce()) {
47 47 wp_die(esc_html__('Security check failed. Please refresh and try again.', 'fluent-booking'), 403);
48 48 }
49 49
50 - if (!PermissionManager::hasAllCalendarAccess()) {
51 - die(esc_html__('You do not have permission to export data', 'fluent-booking'));
52 - }
53 -
54 50 $groupId = isset($_REQUEST['group_id']) ? (int)$_REQUEST['group_id'] : null; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
55 51
56 52 if (!$groupId) {
57 53 die(esc_html__('Please provide Group ID', 'fluent-booking'));
@@ -58,8 +54,16 @@
58 54 }
59 55
60 56 $attendees = Booking::where('group_id', $groupId)->get();
61 57
58 + if ($attendees->isEmpty()) {
59 + die(esc_html__('No bookings found for the provided Group ID', 'fluent-booking'));
60 + }
61 +
62 + if (!PermissionManager::userCanSeeAllBookings() && !$attendees->first()->hasBookingAccess()) {
63 + die(esc_html__('You do not have permission to export this group\'s attendees', 'fluent-booking'));
64 + }
65 +
62 66 $csvData[] = [
63 67 'First Name',
64 68 'Last Name',
65 69 'Email',
@@ -194,10 +198,9 @@
194 198 ];
195 199 }
196 200
197 201 /**
198 - * Sanitize a value for safe CSV output: neutralize formula injection and strip control chars.
199 - * Prefix with single quote when value starts with =, +, -, or @ so spreadsheets treat as text.
202 + * Make a value safe for CSV: strip control chars and neutralize formula injection.
200 203 *
201 204 * @param mixed $value Cell value (string, number, or null).
202 205 * @return string Safe string for fputcsv.
203 206 */