Skip to content

Commit

Permalink
Merge pull request #2993 from nextcloud/backport/2991/stable28
Browse files Browse the repository at this point in the history
[stable28] Trim whitespace from mountpoint names
  • Loading branch information
artonge authored Jun 6, 2024
2 parents 2e1bc07 + 91f25ca commit 7249099
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 7249099

Please # to comment.