From 4f15b00e84be0915c9678e10ae12e97193839d37 Mon Sep 17 00:00:00 2001 From: Victoria Hoang <118122474+victori444@users.noreply.github.com> Date: Mon, 18 Nov 2024 10:20:41 -0500 Subject: [PATCH] [document_repository] Error for filenames with comma (#9461) Fix downloading of files with commas in document repository by url encoding the filename. --- modules/document_repository/jsx/docIndex.js | 2 +- php/libraries/FilesDownloadHandler.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/document_repository/jsx/docIndex.js b/modules/document_repository/jsx/docIndex.js index a8f62ed3b7c..7e1a7a23c88 100644 --- a/modules/document_repository/jsx/docIndex.js +++ b/modules/document_repository/jsx/docIndex.js @@ -183,7 +183,7 @@ class DocIndex extends React.Component { {cell} diff --git a/php/libraries/FilesDownloadHandler.php b/php/libraries/FilesDownloadHandler.php index e46d4038d5f..9782b5ba1a1 100644 --- a/php/libraries/FilesDownloadHandler.php +++ b/php/libraries/FilesDownloadHandler.php @@ -99,7 +99,7 @@ public function handle(ServerRequestInterface $request) : ResponseInterface return (new \LORIS\Http\Response\JSON\OK()) ->withHeader( 'Content-Disposition', - 'attachment; filename=' . $filename + 'attachment; filename=' . urlencode($filename) ) ->withHeader( 'Content-Type',