From c0ac98066e717ac8dba98df5bbfe881c9b344495 Mon Sep 17 00:00:00 2001 From: Qingping Hou <dave2008713@gmail.com> Date: Mon, 18 Feb 2013 09:49:50 -0500 Subject: [PATCH] check filename and timestamp in Trashbin's file_exists method --- apps/files_trashbin/lib/trash.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php index 8cb44d0a68..a948b47e0a 100644 --- a/apps/files_trashbin/lib/trash.php +++ b/apps/files_trashbin/lib/trash.php @@ -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); } -- GitLab