summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-11-25 10:06:04 +0100
committerGitHub <noreply@github.com>2019-11-25 10:06:04 +0100
commitdaa636260f2704d0536599b144e3abf5fe83b565 (patch)
treece5f734a642add0af0e8c62c55fea3d146c6110d /lib
parentda45eee63417882febbc30540b510e67d81b87af (diff)
parent9a64759af55ecfb9c13da79b6e4ca0384201d18f (diff)
downloadnextcloud-server-daa636260f2704d0536599b144e3abf5fe83b565.tar.gz
nextcloud-server-daa636260f2704d0536599b144e3abf5fe83b565.zip
Merge pull request #18073 from nextcloud/harden/cache/watcher
Harden watcher
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Cache/Watcher.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Files/Cache/Watcher.php b/lib/private/Files/Cache/Watcher.php
index 47dde26d7b7..8c5cb0db182 100644
--- a/lib/private/Files/Cache/Watcher.php
+++ b/lib/private/Files/Cache/Watcher.php
@@ -85,7 +85,7 @@ class Watcher implements IWatcher {
if (is_null($cachedEntry)) {
$cachedEntry = $this->cache->get($path);
}
- if ($this->needsUpdate($path, $cachedEntry)) {
+ if ($cachedEntry === false || $this->needsUpdate($path, $cachedEntry)) {
$this->update($path, $cachedEntry);
return true;
} else {
@@ -105,7 +105,7 @@ class Watcher implements IWatcher {
} else {
$this->scanner->scanFile($path);
}
- if ($cachedData['mimetype'] === 'httpd/unix-directory') {
+ if (is_array($cachedData) && $cachedData['mimetype'] === 'httpd/unix-directory') {
$this->cleanFolder($path);
}
if ($this->cache instanceof Cache) {