diff options
author | Qingping Hou <dave2008713@gmail.com> | 2013-02-18 09:49:50 -0500 |
---|---|---|
committer | Qingping Hou <dave2008713@gmail.com> | 2013-02-18 09:49:50 -0500 |
commit | c0ac98066e717ac8dba98df5bbfe881c9b344495 (patch) | |
tree | 4c92d16e82de00c8a226771dc4c0f70f5085b042 /apps/files_trashbin | |
parent | 4b4b1f86925248a36c4cc62e91905e605b891e70 (diff) | |
download | nextcloud-server-c0ac98066e717ac8dba98df5bbfe881c9b344495.tar.gz nextcloud-server-c0ac98066e717ac8dba98df5bbfe881c9b344495.zip |
check filename and timestamp in Trashbin's file_exists method
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r-- | apps/files_trashbin/lib/trash.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php index 8cb44d0a684..a948b47e0ad 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); } |