]> source.dussan.org Git - nextcloud-server.git/commitdiff
Don't strip path from directory prefix
authorDaniel Kesselberg <mail@danielkesselberg.de>
Thu, 14 Feb 2019 17:06:09 +0000 (18:06 +0100)
committerDaniel Kesselberg <mail@danielkesselberg.de>
Mon, 23 Sep 2019 12:03:41 +0000 (14:03 +0200)
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
apps/files_external/lib/Lib/Storage/AmazonS3.php

index 019bfa17b3c71556b08a478131d0d1272395cd96..befa65671004fa3a5feda206a1d0ccd0577b8dc7 100644 (file)
@@ -335,7 +335,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
                                if (is_array($result['CommonPrefixes'])) {
                                        foreach ($result['CommonPrefixes'] as $prefix) {
                                                $files[] = substr(trim($prefix['Prefix'], '/'), strlen($path));
-                                               $this->directoryCache[substr(trim($prefix['Prefix'], '/'), strlen($path))] = true;
+                                               $this->directoryCache[trim($prefix['Prefix'], '/')] = true;
                                        }
                                }
                                if (is_array($result['Contents'])) {
@@ -433,6 +433,11 @@ class AmazonS3 extends \OC\Files\Storage\Common {
 
        public function is_dir($path) {
                $path = $this->normalizePath($path);
+
+               if (isset($this->filesCache[$path])) {
+                       return false;
+               }
+
                try {
                        return $this->isRoot($path) || $this->doesDirectoryExist($path);
                } catch (S3Exception $e) {