diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-09-27 10:30:55 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2023-10-10 15:28:52 +0200 |
commit | 35aed73edeffebb9b924cdd13e8b9881f1cd07ab (patch) | |
tree | 3956665427f1b98fd5c84ef1920361366a5fdf85 /apps/files/lib | |
parent | 9de246d74f72e290197efd0335aacc6f854cbc9a (diff) | |
download | nextcloud-server-35aed73edeffebb9b924cdd13e8b9881f1cd07ab.tar.gz nextcloud-server-35aed73edeffebb9b924cdd13e8b9881f1cd07ab.zip |
feat: allow external drop and add dropzone
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/Controller/ViewController.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php index 88d9a32039b..38e3858cd38 100644 --- a/apps/files/lib/Controller/ViewController.php +++ b/apps/files/lib/Controller/ViewController.php @@ -237,9 +237,11 @@ class ViewController extends Controller { if ($fileid && $dir !== '') { $baseFolder = $this->rootFolder->getUserFolder($userId); $nodes = $baseFolder->getById((int) $fileid); - $relativePath = dirname($baseFolder->getRelativePath($nodes[0]->getPath())); - // If the requested path is different from the file path - if (count($nodes) === 1 && $relativePath !== $dir) { + $nodePath = $baseFolder->getRelativePath($nodes[0]->getPath()); + $relativePath = $nodePath ? dirname($nodePath) : ''; + // If the requested path does not contain the file id + // or if the requested path is not the file id itself + if (count($nodes) === 1 && $relativePath !== $dir && $nodePath !== $dir) { return $this->redirectToFile((int) $fileid); } } |