fix(FilesDropPlugin): Allow MKCOL for file drop to upload folders

Signed-off-by: provokateurin <kate@provokateurin.de>
pull/55807/head
provokateurin 3 months ago
parent d332ab60d3
commit ff1772f4bc
No known key found for this signature in database
  1. 9
      apps/dav/lib/Files/Sharing/FilesDropPlugin.php

@ -113,7 +113,6 @@ class FilesDropPlugin extends ServerPlugin {
$rootPath = substr($path, 0, strpos($path, $token) + strlen($token));
// e.g /Folder/image.jpg
$relativePath = substr($path, strlen($rootPath));
$isRootUpload = substr_count($relativePath, '/') === 1;
// Extract the attributes for the file request
$isFileRequest = false;
@ -132,14 +131,6 @@ class FilesDropPlugin extends ServerPlugin {
throw new BadRequest('A nickname header is required for file requests');
}
// We're only allowing the upload of
// long path with subfolders if a nickname is set.
// This prevents confusion when uploading files and help
// classify them by uploaders.
if (!$nickname && !$isRootUpload) {
throw new BadRequest('A nickname header is required when uploading subfolders');
}
if ($nickname) {
try {
$node->verifyPath($nickname);

Loading…
Cancel
Save