Skip to content

Commit de76036

Browse files
committed
fix?
1 parent 59aecc5 commit de76036

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/Illuminate/Filesystem/AwsS3V3Adapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(FilesystemOperator $driver, FlysystemAdapter $adapte
3434
$this->client = $client;
3535

3636
$this->prefixer = isset($config['prefix'])
37-
? new PathPrefixer($this->prefixer->prefixPath($config['prefix']), '/')
37+
? new PathPrefixer($this->prefixer->prefixPath(''), '/')
3838
: new PathPrefixer($config['root'] ?? '', '/');
3939
}
4040

tests/Filesystem/FilesystemAdapterTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,4 +752,22 @@ public function testGetChecksum()
752752
$this->assertEquals('730bed78bccf58c2cfe44c29b71e5e6b', $filesystemAdapter->checksum('path.txt'));
753753
$this->assertEquals('a5c3556d', $filesystemAdapter->checksum('path.txt', ['checksum_algo' => 'crc32']));
754754
}
755+
756+
public function testUsesRightSeperatorForS3AdapterWithoutDoublePrefixing()
757+
{
758+
$filesystem = new FilesystemManager(new Application);
759+
$filesystemAdapter = $filesystem->createS3Driver([
760+
'region' => 'us-west-1',
761+
'bucket' => 'laravel',
762+
'root' => 'my-root',
763+
'prefix' => 'someprefix',
764+
]);
765+
766+
$path = $filesystemAdapter->path('different');
767+
768+
$this->assertStringContainsString('/someprefix', $path);
769+
$this->assertStringNotContainsString('/someprefix/someprefix', $path);
770+
$this->assertStringContainsString('/', $path);
771+
$this->assertStringNotContainsString('\\', $path);
772+
}
755773
}

0 commit comments

Comments
 (0)