diff --git a/apps/files/ajax/delete.php b/apps/files/ajax/delete.php index f6aa4f0c90..a28b7b76c9 100644 --- a/apps/files/ajax/delete.php +++ b/apps/files/ajax/delete.php @@ -7,20 +7,17 @@ OCP\JSON::callCheck(); // Get data $dir = stripslashes($_POST["dir"]); -$files = isset($_POST["file"]) ? $_POST["file"] : $_POST["files"]; $allFiles = isset($_POST["allfiles"]) ? $_POST["allfiles"] : false; -if ($allFiles === 'true') { - $allFiles = true; -} // delete all files in dir ? -if ($allFiles) { +if ($allFiles === 'true') { $files = array(); $fileList = \OC\Files\Filesystem::getDirectoryContent($dir); foreach ($fileList as $fileInfo) { $files[] = $fileInfo['name']; } } else { + $files = isset($_POST["file"]) ? $_POST["file"] : $_POST["files"]; $files = json_decode($files); } $filesWithError = '';