From: Jörn Friedrich Dreyer Date: Thu, 14 Aug 2014 15:23:19 +0000 (+0200) Subject: use S3Client::encodeKey(), fixes #8325 X-Git-Tag: v8.0.0alpha1~861^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=240b9523334a1ae90e83e566d332c453f41f8351;p=nextcloud-server.git use S3Client::encodeKey(), fixes #8325 --- diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index 3b0ae5bbe0d..60d2677ddda 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -56,6 +56,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { /** * @param string $path + * @return string correctly encoded path */ private function normalizePath($path) { $path = trim($path, '/'); @@ -436,7 +437,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { $result = $this->connection->copyObject(array( 'Bucket' => $this->bucket, 'Key' => $this->cleanKey($path2), - 'CopySource' => $this->bucket . '/' . $path1 + 'CopySource' => S3Client::encodeKey($this->bucket . '/' . $path1) )); $this->testTimeout(); } catch (S3Exception $e) { @@ -452,7 +453,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { $result = $this->connection->copyObject(array( 'Bucket' => $this->bucket, 'Key' => $path2 . '/', - 'CopySource' => $this->bucket . '/' . $path1 . '/' + 'CopySource' => S3Client::encodeKey($this->bucket . '/' . $path1 . '/') )); $this->testTimeout(); } catch (S3Exception $e) {