From c98b7fe7fceeb90f3fc25bc1a27c7e22341b5e4a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 23 Jun 2014 18:10:08 +0200 Subject: [PATCH] Merge if statements --- apps/files/ajax/delete.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/files/ajax/delete.php b/apps/files/ajax/delete.php index 9f8621f604..a28b7b76c9 100644 --- a/apps/files/ajax/delete.php +++ b/apps/files/ajax/delete.php @@ -8,20 +8,16 @@ OCP\JSON::callCheck(); // Get data $dir = stripslashes($_POST["dir"]); $allFiles = isset($_POST["allfiles"]) ? $_POST["allfiles"] : false; -if ($allFiles === 'true') { - $allFiles = true; -} else { - $files = isset($_POST["file"]) ? $_POST["file"] : $_POST["files"]; -} // 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 = '';