1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-09-20 11:14:03 +00:00

rtrim directory and public root in remove symlinks action

realpath() already returns paths without the trailing separator -- rtrim is used just so that the code is more self=documenting.
This commit is contained in:
lukinovec 2026-09-11 07:05:10 +02:00
parent 9e890e9a67
commit 9ec732cfce

View file

@ -66,7 +66,7 @@ class RemoveStorageSymlinksAction
// Remove the directories CreateStorageSymlinksAction created for the symlink
// until a non-empty one is reached.
while (str_starts_with($directory, $publicRoot . DIRECTORY_SEPARATOR) && $files->isEmptyDirectory($directory)) {
while (str_starts_with(rtrim($directory, '/\\'), rtrim($publicRoot, '/\\') . DIRECTORY_SEPARATOR) && $files->isEmptyDirectory($directory)) {
$files->deleteDirectory($directory);
$directory = dirname($directory);