diff options
author | Björn Schießle <bjoern@schiessle.org> | 2013-02-19 03:09:03 -0800 |
---|---|---|
committer | Björn Schießle <bjoern@schiessle.org> | 2013-02-19 03:09:03 -0800 |
commit | 95751874a14c4fd9a52061823d8fe732b3ff3609 (patch) | |
tree | 99719e2ef150bb49903a6726dc7791a9d0e99790 /apps/files_trashbin/lib | |
parent | 3d7545269bae7aa38de2abbc4d327beab986fc82 (diff) | |
parent | c0ac98066e717ac8dba98df5bbfe881c9b344495 (diff) | |
download | nextcloud-server-95751874a14c4fd9a52061823d8fe732b3ff3609.tar.gz nextcloud-server-95751874a14c4fd9a52061823d8fe732b3ff3609.zip |
Merge pull request #1740 from houqp/issue#1688
Bug fix for Issue#1688
Diffstat (limited to 'apps/files_trashbin/lib')
-rw-r--r-- | apps/files_trashbin/lib/trash.php | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php index fbc3954c040..8d54a471b42 100644 --- a/apps/files_trashbin/lib/trash.php +++ b/apps/files_trashbin/lib/trash.php @@ -246,8 +246,27 @@ class Trashbin { return $size;
} - - + + /** + * check to see whether a file exists in trashbin + * @param $filename path to the file + * @param $timestamp of deletion time + * @return true if file exists, otherwise false + */ + public static function file_exists($filename, $timestamp=null) { + $user = \OCP\User::getUser(); + $view = new \OC_FilesystemView('/'.$user); + + if ($timestamp) { + $filename = $filename.'.d'.$timestamp; + } else { + $filename = $filename; + } + + $target = \OC_Filesystem::normalizePath('files_trashbin/'.$filename); + return $view->file_exists($target); + } + /**
* clean up the trash bin * @param max. available disk space for trashbin
|