Skip to content

Commit

Permalink
fixup! feat(Call): allow moderators to download current attendance list
Browse files Browse the repository at this point in the history
  • Loading branch information
DorraJaouad committed Oct 17, 2024
1 parent 05934fc commit 63ba64a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/Controller/CallController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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('/[\/\\:*?"<>|\- ]+/', '-', $this->room->getName());
// Limit to a reasonable length
$cleanedRoomName = substr($cleanedRoomName, 0, 100);
$date = $this->timeFactory->getDateTime()->format('Y-m-d');
$fileName = $cleanedRoomName . ' ' . $date . '.csv';

return new DataDownloadResponse(stream_get_contents($output), $fileName, 'text/csv');
}

/**
Expand Down

0 comments on commit 63ba64a

Please sign in to comment.