From b1e6592b0eb47de076de5f8a1774b9beaaae6402 Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Wed, 5 Jun 2024 17:06:23 +0200 Subject: [PATCH] fix: Trim whitespace from mountpoint names Signed-off-by: Louis Chemineau --- lib/Controller/FolderController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Controller/FolderController.php b/lib/Controller/FolderController.php index 56e7989d1..6ed421019 100644 --- a/lib/Controller/FolderController.php +++ b/lib/Controller/FolderController.php @@ -161,7 +161,7 @@ private function getRootFolderStorageId(): ?int { * @NoAdminRequired */ public function addFolder(string $mountpoint): DataResponse { - $id = $this->manager->createFolder($mountpoint); + $id = $this->manager->createFolder(trim($mountpoint)); return new DataResponse(['id' => $id]); } @@ -185,7 +185,7 @@ public function removeFolder(int $id): DataResponse { * @RequireGroupFolderAdmin */ public function setMountPoint(int $id, string $mountPoint): DataResponse { - $this->manager->setMountPoint($id, $mountPoint); + $this->manager->setMountPoint($id, trim($mountPoint)); return new DataResponse(['success' => true]); } @@ -277,7 +277,7 @@ public function renameFolder(int $id, string $mountpoint): DataResponse { if ($response) { return $response; } - $this->manager->renameFolder($id, $mountpoint); + $this->manager->renameFolder($id, trim($mountpoint)); return new DataResponse(['success' => true]); }