Skip to content

Commit

Permalink
[document_repository] Error for filenames with comma (#9461)
Browse files Browse the repository at this point in the history
Fix downloading of files with commas in document repository by url encoding the filename.
  • Loading branch information
victori444 authored Nov 18, 2024
1 parent 464dd8b commit 4f15b00
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/document_repository/jsx/docIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class DocIndex extends React.Component {
<a
href={downloadURL}
target="_blank"
download={row['File Name']}
download={encodeURIComponent(row['File Name'])}
>
{cell}
</a>
Expand Down
2 changes: 1 addition & 1 deletion php/libraries/FilesDownloadHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 4f15b00

Please sign in to comment.