diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-22 13:37:42 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-22 13:38:16 +0100 |
commit | 9a64759af55ecfb9c13da79b6e4ca0384201d18f (patch) | |
tree | 6ecf1f31c2bb7236435c3ae2b7c2283cdc08b100 | |
parent | 21119633041d5ccae19975a58b0ae50ef5a8e33a (diff) | |
download | nextcloud-server-9a64759af55ecfb9c13da79b6e4ca0384201d18f.tar.gz nextcloud-server-9a64759af55ecfb9c13da79b6e4ca0384201d18f.zip |
Harden watcher
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r-- | lib/private/Files/Cache/Watcher.php | 4 |
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) { |