Skip to content

Commit

Permalink
Fix server side copy of files with spaces in name
Browse files Browse the repository at this point in the history
Urlencode is not RFC 3986 compliant as it encodes spaces as plus (+)
signs breaking S3 implementations that expect compliant encoding. Using
rawurlencode instead fixes this.
  • Loading branch information
taisph committed May 22, 2019
1 parent 883b02c commit dd44e6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/AwsS3Adapter.php
Expand Up @@ -409,7 +409,7 @@ public function copy($path, $newpath)
[
'Bucket' => $this->bucket,
'Key' => $this->applyPathPrefix($newpath),
'CopySource' => urlencode($this->bucket . '/' . $this->applyPathPrefix($path)),
'CopySource' => rawurlencode($this->bucket . '/' . $this->applyPathPrefix($path)),
'ACL' => $this->getRawVisibility($path) === AdapterInterface::VISIBILITY_PUBLIC
? 'public-read' : 'private',
] + $this->options
Expand Down

0 comments on commit dd44e6e

Please sign in to comment.