Skip to content
Snippets Groups Projects
Commit c0ac9806 authored by Qingping Hou's avatar Qingping Hou
Browse files

check filename and timestamp in Trashbin's file_exists method

parent 4b4b1f86
No related branches found
No related tags found
No related merge requests found
......@@ -249,13 +249,21 @@ class Trashbin {
/**
* check to see whether a file exists in trashbin
* @param $file path to the file to check
* @param $filename path to the file
* @param $timestamp of deletion time
* @return true if file exists, otherwise false
*/
public static function file_exists($file) {
public static function file_exists($filename, $timestamp=null) {
$user = \OCP\User::getUser();
$view = new \OC_FilesystemView('/'.$user);
$target = \OC_Filesystem::normalizePath('files_trashbin/'.$file);
if ($timestamp) {
$filename = $filename.'.d'.$timestamp;
} else {
$filename = $filename;
}
$target = \OC_Filesystem::normalizePath('files_trashbin/'.$filename);
return $view->file_exists($target);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment