diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-03-17 17:03:32 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-03-17 17:03:32 +0100 |
commit | 38b1529c2a24a0fc58ce78a444f918750442a8aa (patch) | |
tree | f94f172cd10eaddc8cdbce035be3f71c094524d8 /apps/files_trashbin | |
parent | 332c14a878e438cac22ca7da9a65af1647471452 (diff) | |
download | nextcloud-server-38b1529c2a24a0fc58ce78a444f918750442a8aa.tar.gz nextcloud-server-38b1529c2a24a0fc58ce78a444f918750442a8aa.zip |
More robust way to check if the folder is empty
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r-- | apps/files_trashbin/lib/trashbin.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php index dc38c339ecb..62879b0ca85 100644 --- a/apps/files_trashbin/lib/trashbin.php +++ b/apps/files_trashbin/lib/trashbin.php @@ -922,9 +922,12 @@ class Trashbin { $view = new \OC\Files\View('/' . $user . '/files_trashbin'); $dh = $view->opendir('/files'); - readdir($dh); //'..' - readdir($dh); //'.' - return readdir($dh) === false; + while ($file = readdir($dh)) { + if($file !== '.' and $file !== '..'){ + return false; + } + } + return true; } public static function preview_icon($path) { |