More robust way to check if the folder is empty
This commit is contained in:
parent
332c14a878
commit
38b1529c2a
1 changed files with 6 additions and 3 deletions
|
@ -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 a new issue