From e6c39fc3e7e11b22c20df361fb891523e8c89a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Schie=C3=9Fle?= Date: Tue, 19 Feb 2013 12:14:44 +0100 Subject: [PATCH] change $_REQUEST to $_POST; fix check if file was successfully deleted --- apps/files_trashbin/ajax/delete.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/files_trashbin/ajax/delete.php b/apps/files_trashbin/ajax/delete.php index d922fafeb2..7684d0465e 100644 --- a/apps/files_trashbin/ajax/delete.php +++ b/apps/files_trashbin/ajax/delete.php @@ -3,8 +3,8 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::callCheck(); -$files = $_REQUEST['files']; -$dirlisting = $_REQUEST['dirlisting']; +$files = $_POST['files']; +$dirlisting = $_POST['dirlisting']; $list = explode(';', $files); if (!is_array($list)){ @@ -24,8 +24,9 @@ foreach ($list as $file) { $filename = $file; $timestamp = null; } - - if(OCA\Files_Trashbin\Trashbin::delete($filename, $timestamp)) { + + OCA\Files_Trashbin\Trashbin::delete($filename, $timestamp); + if (!OCA\Files_Trashbin\Trashbin::file_exists($filename)) { $success[$i]['filename'] = $file; $success[$i]['timestamp'] = $timestamp; $i++; @@ -40,7 +41,7 @@ if ( $error ) { $filelist .= $e.', '; } $l = OC_L10N::get('files_trashbin'); - $message = $l->t("Couldn't restore %s", array(rtrim($filelist, ', '))); + $message = $l->t("Couldn't delete %s permanently", array(rtrim($filelist, ', '))); OCP\JSON::error(array("data" => array("message" => $message, "success" => $success, "error" => $error))); } else {