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');
|
$view = new \OC\Files\View('/' . $user . '/files_trashbin');
|
||||||
$dh = $view->opendir('/files');
|
$dh = $view->opendir('/files');
|
||||||
readdir($dh); //'..'
|
while ($file = readdir($dh)) {
|
||||||
readdir($dh); //'.'
|
if($file !== '.' and $file !== '..'){
|
||||||
return readdir($dh) === false;
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function preview_icon($path) {
|
public static function preview_icon($path) {
|
||||||
|
|
Loading…
Reference in a new issue