From 857c6fc233b7fa17fa9288f7457206694fa964d2 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Wed, 26 Aug 2026 17:11:59 +0200 Subject: [PATCH] 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. --- src/Bootstrappers/FilesystemTenancyBootstrapper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bootstrappers/FilesystemTenancyBootstrapper.php b/src/Bootstrappers/FilesystemTenancyBootstrapper.php index 57548d8d..c91e7f98 100644 --- a/src/Bootstrappers/FilesystemTenancyBootstrapper.php +++ b/src/Bootstrappers/FilesystemTenancyBootstrapper.php @@ -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; }