aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@karoshi.org.uk>2014-04-17 11:56:51 +0100
committerRobin McCorkell <rmccorkell@karoshi.org.uk>2014-04-17 11:56:51 +0100
commit13b463cc176cb547f2b5585e974c9357150585a2 (patch)
tree6018560825429155889666c9ea1abfa784e9d458 /apps/files_trashbin
parent8a0c8a1956f5c9f2959a48cf5c3df01eb8f61a9c (diff)
parent8bb003868c9f319e387bf464a035a3b2fd123531 (diff)
downloadnextcloud-server-13b463cc176cb547f2b5585e974c9357150585a2.tar.gz
nextcloud-server-13b463cc176cb547f2b5585e974c9357150585a2.zip
Merge pull request #8189 from Xenopathic/misc_fixes
Various fixes
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/lib/trashbin.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php
index 7b14a4ec081..9b931333b7f 100644
--- a/apps/files_trashbin/lib/trashbin.php
+++ b/apps/files_trashbin/lib/trashbin.php
@@ -824,13 +824,15 @@ class Trashbin {
$matches = glob($escapedVersionsName . '*');
}
- foreach ($matches as $ma) {
- if ($timestamp) {
- $parts = explode('.v', substr($ma, 0, $offset));
- $versions[] = (end($parts));
- } else {
- $parts = explode('.v', $ma);
- $versions[] = (end($parts));
+ if (is_array($matches)) {
+ foreach ($matches as $ma) {
+ if ($timestamp) {
+ $parts = explode('.v', substr($ma, 0, $offset));
+ $versions[] = (end($parts));
+ } else {
+ $parts = explode('.v', $ma);
+ $versions[] = (end($parts));
+ }
}
}
return $versions;
@@ -921,13 +923,11 @@ class Trashbin {
public static function isEmpty($user) {
$view = new \OC\Files\View('/' . $user . '/files_trashbin');
- $dh = $view->opendir('/files');
- if (!$dh) {
- return false;
- }
- while ($file = readdir($dh)) {
- if ($file !== '.' and $file !== '..') {
- return false;
+ if ($view->is_dir('/files') && $dh = $view->opendir('/files')) {
+ while ($file = readdir($dh)) {
+ if ($file !== '.' and $file !== '..') {
+ return false;
+ }
}
}
return true;