mirror of
https://github.com/nextcloud/server.git
synced 2024-08-13 14:11:10 +02:00
More robust way to check if the folder is empty
This commit is contained in:
parent
332c14a878
commit
38b1529c2a
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user