From fad6c9032082b3e0c67799ec791c11f7f2365809 Mon Sep 17 00:00:00 2001 From: DorraJaouad Date: Wed, 16 Oct 2024 11:33:29 +0200 Subject: [PATCH] fixup! feat(Call): allow moderators to download current attendance list --- lib/Controller/CallController.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Controller/CallController.php b/lib/Controller/CallController.php index 5fb7156272f..83c557f5c90 100644 --- a/lib/Controller/CallController.php +++ b/lib/Controller/CallController.php @@ -159,7 +159,14 @@ public function downloadParticipantsForCall(string $format = 'csv'): DataDownloa fseek($output, 0); - return new DataDownloadResponse(stream_get_contents($output), 'participants.csv', 'text/csv'); + // Clean the room name + $cleanedRoomName = preg_replace('/-+/', '-', preg_replace('/[\/\\:*?"<>|]/', '-', $this->room->getName())); + // Limit to a reasonable length + $cleanedRoomName = substr($cleanedRoomName, 0, 100); + $date = (new \DateTime())->format('Y-m-d'); + $fileName = "{$cleanedRoomName} - {$date}.csv"; + + return new DataDownloadResponse(stream_get_contents($output), $fileName, 'text/csv'); } /**