summaryrefslogtreecommitdiffstats
path: root/apps/files/ajax/delete.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/ajax/delete.php')
-rw-r--r--apps/files/ajax/delete.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/files/ajax/delete.php b/apps/files/ajax/delete.php
index 1a810f6954c..e891bb86208 100644
--- a/apps/files/ajax/delete.php
+++ b/apps/files/ajax/delete.php
@@ -6,18 +6,18 @@ OCP\JSON::callCheck();
// Get data
-$dir = isset($_POST['dir']) ? $_POST['dir'] : '';
-$allFiles = isset($_POST["allfiles"]) ? $_POST["allfiles"] : false;
+$dir = isset($_POST['dir']) ? (string)$_POST['dir'] : '';
+$allFiles = isset($_POST["allfiles"]) ? (bool)$_POST["allfiles"] : false;
// delete all files in dir ?
-if ($allFiles === 'true') {
+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 = isset($_POST["file"]) ? (string)$_POST["file"] : (string)$_POST["files"];
$files = json_decode($files);
}
$filesWithError = '';