aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Knorr <jus@bitgrid.net>2025-04-07 20:47:11 +0200
committerJulius Knorr <jus@bitgrid.net>2025-04-07 20:47:11 +0200
commit7fa3f89ef93110efbd3af344c218fc279fcffe30 (patch)
tree49473a7de1c9a61202a38f4cf1f8afc921a52841
parent403c33a640a5ffe57ce68d4c097fe74d94431145 (diff)
downloadnextcloud-server-7fa3f89ef93110efbd3af344c218fc279fcffe30.tar.gz
nextcloud-server-7fa3f89ef93110efbd3af344c218fc279fcffe30.zip
fix: Proper order for checking path prefix for getting file by id from cache
Signed-off-by: Julius Knorr <jus@bitgrid.net>
-rw-r--r--lib/private/Files/Node/Root.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/Files/Node/Root.php b/lib/private/Files/Node/Root.php
index d4ec241654b..18062eab6f0 100644
--- a/lib/private/Files/Node/Root.php
+++ b/lib/private/Files/Node/Root.php
@@ -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