Browse Source

Merge pull request #18073 from nextcloud/harden/cache/watcher

Harden watcher
pull/18107/head
Roeland Jago Douma 6 years ago
committed by GitHub
parent
commit
daa636260f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      lib/private/Files/Cache/Watcher.php

4
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) {

Loading…
Cancel
Save