Skip to content

Commit

Permalink
Set utf-8 encoding in signed URL filename header
Browse files Browse the repository at this point in the history
Change-Id: Ia71b2789783da26e2c10875f2a4edf3d1b3951cd
  • Loading branch information
marxjohnson committed Jun 27, 2022
1 parent 2a30030 commit 8e107e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/local/store/s3/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ private function generate_presigned_url_cloudfront($contenthash, array $headers
$result = $this->get_nice_filename($headers);
if (!empty($result)) {
$key .= '?response-content-disposition=' .
rawurlencode($result['Content-Disposition'] . ';' . $result['filename']) .
rawurlencode($result['Content-Disposition']) . ';' . $result['filename'] .
'&response-content-type=' . rawurlencode($result['Content-Type']);
} else {
$key .= '';
Expand Down Expand Up @@ -604,7 +604,7 @@ private function get_nice_filename($headers) {

if (!empty($originalfilename)) {
$result['Content-Disposition'] = $contentdisposition;
$result['filename'] = 'filename="' . utf8_encode($originalfilename) . '"';
$result['filename'] = "filename*=utf-8''" . rawurlencode($originalfilename);
$result['Content-Type'] = $originalcontenttype;
}
}
Expand Down

0 comments on commit 8e107e6

Please sign in to comment.