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 16, 2024
1 parent 05934fc commit fad6c90
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('/-+/', '-', 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');
}

/**
Expand Down

0 comments on commit fad6c90

Please sign in to comment.