]> source.dussan.org Git - nextcloud-server.git/commitdiff
use S3Client::encodeKey(), fixes #8325
authorJörn Friedrich Dreyer <jfd@butonic.de>
Thu, 14 Aug 2014 15:23:19 +0000 (17:23 +0200)
committerJörn Friedrich Dreyer <jfd@butonic.de>
Thu, 14 Aug 2014 19:46:50 +0000 (21:46 +0200)
apps/files_external/lib/amazons3.php

index 3b0ae5bbe0dcc632f08b11706804047779ffa4ac..60d2677ddda87b332baba2d8b0d15579e7e6c27c 100644 (file)
@@ -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) {