mirror of
https://github.com/archtechx/tenancy.git
synced 2026-09-20 14:14:03 +00:00
Trim any trailing separator from the original root in diskRoot
Since $originalRoot can be an OS path (with local disks without root_override) or a remote path/key (e.g. with S3 or FTP), we can't assume either separator while trimming. Trimming only '/' missed a trailing '\' on a Windows local root, so e.g. 'C:\app\uploads\' became 'C:\app\uploads\/tenant1'. (The appended '/' stays as is -- it's accepted on Windows and it's the only correct separator for remote disks.) Note that in practice, this wasn't an issue that could break anything. But assuming '/' in the rtrim code was incorrect.
This commit is contained in:
parent
bd101797ea
commit
857c6fc233
1 changed files with 1 additions and 1 deletions
|
|
@ -164,7 +164,7 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
|
|||
// This is executed if the disk is in tenancy.filesystem.disks but does NOT have a root_override
|
||||
// This behavior is used for disks like S3.
|
||||
$newRoot = $originalRoot
|
||||
? rtrim($originalRoot, '/') . '/' . $suffix
|
||||
? rtrim($originalRoot, '/\\') . '/' . $suffix
|
||||
: $suffix;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue