mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
fix: Proper order for checking path prefix for getting file by id from cache
Signed-off-by: Julius Knorr <jus@bitgrid.net>
This commit is contained in:
parent
403c33a640
commit
7fa3f89ef9
1 changed files with 1 additions and 1 deletions
|
|
@ -384,7 +384,7 @@ class Root extends Folder implements IRootFolder {
|
|||
// scope the cache by user, so we don't return nodes for different users
|
||||
if ($this->user) {
|
||||
$cachedPath = $this->pathByIdCache->get($this->user->getUID() . '::' . $id);
|
||||
if ($cachedPath && str_starts_with($path, $cachedPath)) {
|
||||
if ($cachedPath && str_starts_with($cachedPath, $path)) {
|
||||
// getting the node by path is significantly cheaper than finding it by id
|
||||
$node = $this->get($cachedPath);
|
||||
// by validating that the cached path still has the requested fileid we can work around the need to invalidate the cached path
|
||||
|
|
|
|||
Loading…
Reference in a new issue