Bugzilla – Attachment 119610 Details for
Bug 28123
Commas in file names of uploaded files cause inconsistently broken 856$u links
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28123: Quote filename value in Content-Disposition header
Bug-28123-Quote-filename-value-in-Content-Disposit.patch (text/plain), 1.67 KB, created by
Owen Leonard
on 2021-04-15 10:59:58 UTC
(
hide
)
Description:
Bug 28123: Quote filename value in Content-Disposition header
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-04-15 10:59:58 UTC
Size:
1.67 KB
patch
obsolete
>From 6952a9718364c4bcb4b5b916605a8fd00e697814 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 13 Apr 2021 00:39:04 +0000 >Subject: [PATCH] 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> >--- > Koha/UploadedFile.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/UploadedFile.pm b/Koha/UploadedFile.pm >index 83c7ab76e3..009c333a8d 100644 >--- a/Koha/UploadedFile.pm >+++ b/Koha/UploadedFile.pm >@@ -131,7 +131,7 @@ sub httpheaders { > if( $self->filename =~ /\.pdf$/ ) { > return ( > '-type' => 'application/pdf', >- 'Content-Disposition' => 'inline; filename='.$self->filename, >+ 'Content-Disposition' => 'inline; filename="'.$self->filename.'"', > ); > } else { > return ( >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28123
:
119494
|
119495
|
119610
|
119611
|
119684
|
119685