]> git.koha-community.org Git - koha.git/commit
Bug 28123: Quote filename value in Content-Disposition header
authorDavid Cook <dcook@prosentient.com.au>
Tue, 13 Apr 2021 00:39:04 +0000 (00:39 +0000)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Sun, 25 Apr 2021 16:25:31 +0000 (16:25 +0000)
commitf01869a90cfc48e65e4c0b086b1bffde86043e65
tree75ba614da98fc0560d6376653e76179639936be1
parent97ad010674cd41f28d737b2b5080c07b2c782e3f
Bug 28123: Quote filename value in Content-Disposition header

Chrome throws a ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION
error if a Content-Disposition header includes an unquoted filename
that contains commas.

This patch adds quotes around the filename in the Content-Disposition
header, which fixes the problem.

Test plan:
0. Do not apply the patch yet
1. Obtain a PDF and rename it to include a comma in its name
2. Enable the upload.pl plugin in the 856$u of the Default framework
3. Add/edit a record in the Default Framework and upload a file
using the 856$u upload plugin.
4. Click on the resulting file URL in the saved file
5. Note the error ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION
is returned instead of the file

6. Apply the patch and restart your Plack instance

7. Click on the resulting file URL in the saved file
8. Note that you now get the PDF file instead of the error

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 52f997fcfc88488e1a8bab4a8d52eba6c0501895)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 029936828d3feb57d9ee40a6709d62bc6fbb3124)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Koha/UploadedFile.pm