Skip to content

Commit

Permalink
fix: ending slash when mountpoint is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianRuen committed Jul 8, 2024
1 parent 2d5a485 commit 39bcd8a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/Service/ExternalStorageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,7 @@ private function buildExternalStorageConfiguration(string $fileInternalPath, Sto
// if the mountpoint is not empty, prepend a slash
$mountpoint = trim($resolvedMountpoint, '/');
$filename = ltrim($fileInternalPath, '/');

if ($mountpoint !== '') {
$configuration['filepath'] = '/' . $mountpoint . '/' . $filename;
} else {
$configuration['filepath'] = '/' . $filename;
}
$configuration['filepath'] = $mountpoint !== '' ? ($filename !== '' ? "/$mountpoint/$filename" : "/$mountpoint") : "/$filename";

// check if we need to include auth settings (for metadata call only, not exposed to frontend)
if ($includeAuthSettings) {
Expand Down

0 comments on commit 39bcd8a

Please sign in to comment.