Skip to content

Commit

Permalink
Merge pull request #2991 from nextcloud/artonge/fix/trim_mountpoints_…
Browse files Browse the repository at this point in the history
…name

Trim whitespace from mountpoint names
  • Loading branch information
artonge authored Jun 6, 2024
2 parents 1dfc0f7 + b1e6592 commit 6fe57a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Controller/FolderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

Expand All @@ -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]);
}

Expand Down Expand Up @@ -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]);
}

Expand Down

0 comments on commit 6fe57a1

Please sign in to comment.