From 10de159b889e54cae39cc84ee97574f6763173bf Mon Sep 17 00:00:00 2001 From: lukinovec Date: Thu, 27 Aug 2026 16:17:05 +0200 Subject: [PATCH] Trim any trailing separator from the original storage path in tenantStoragePath Primarily making this change for consistency with diskRoot()'s usage of rtrim (`857c6fc`). With the current Tenancy code, this doesn't fix any real issue, but if tenantStoragePath() got publicly exposed (like in #1479), in very rare cases, issues could arise. For example, when someone configures their storage path to end with a separator, comparing the result of tenantStoragePath() to other strings could behave unexpectedly without rtrim. --- 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 743a1c49..01686915 100644 --- a/src/Bootstrappers/FilesystemTenancyBootstrapper.php +++ b/src/Bootstrappers/FilesystemTenancyBootstrapper.php @@ -97,7 +97,7 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper protected function tenantStoragePath(string $suffix): string { - return $this->originalStoragePath . DIRECTORY_SEPARATOR . $suffix; + return rtrim($this->originalStoragePath, '/\\') . DIRECTORY_SEPARATOR . $suffix; } protected function assetHelper(string|false $suffix): void