Merge pull request #23048 from nextcloud/backport/23034/stable20

[stable20] Fix numeric folders throwing on markDirty
This commit is contained in:
Roeland Jago Douma 2020-09-28 09:32:40 +02:00 committed by GitHub
commit 7630052a60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -38,4 +38,16 @@ class CachingTree extends Tree {
} }
$this->cache[trim($path, '/')] = $node; $this->cache[trim($path, '/')] = $node;
} }
public function markDirty($path) {
// We don't care enough about sub-paths
// flushing the entire cache
$path = trim($path, '/');
foreach ($this->cache as $nodePath => $node) {
$nodePath = (string) $nodePath;
if ('' === $path || $nodePath == $path || 0 === strpos($nodePath, $path.'/')) {
unset($this->cache[$nodePath]);
}
}
}
} }