Skip to content

Commit 3f81024

Browse files
Make sure paths has no leading slashes
1 parent d88e2c9 commit 3f81024

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Backup/Sync/SoftLayer.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ public function setup(array $config)
8989
$this->secret = $config['secret'];
9090
$this->container = $config['container'];
9191
$this->host = $config['host'];
92-
$this->path = String::withTrailingSlash(String::replaceDatePlaceholders($config['path']));
92+
$this->path = String::withoutLeadingSlash(
93+
String::withTrailingSlash(String::replaceDatePlaceholders($config['path']))
94+
);
9395
}
9496

9597
/**
@@ -110,7 +112,7 @@ public function sync(Target $target, Result $result)
110112

111113
try {
112114
/** @var \ObjectStorage_Container $object */
113-
$container = $objectStorage->with($this->container . '/' . $targetPath)
115+
$container = $objectStorage->with($this->container . $targetPath)
114116
->setLocalFile($sourcePath)
115117
->setMeta('description', 'PHPBU Backup: ' . date('r', time()))
116118
->setHeader('Content-Type', $target->getMimeType());

0 commit comments

Comments
 (0)