diff options
author | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2024-03-04 18:13:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-04 18:13:45 +0100 |
commit | 575159b819e87898d09a49ca3fecbf65d200931d (patch) | |
tree | ecc52ba2afecd64fe9ae26f9b1ee93f58f406685 /lib | |
parent | a58ed05f1d19d591a1ed384e87915db952c5f163 (diff) | |
download | nextcloud-server-575159b819e87898d09a49ca3fecbf65d200931d.tar.gz nextcloud-server-575159b819e87898d09a49ca3fecbf65d200931d.zip |
fix(filecache): Move from array_merge to avoid memory exhaustion
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Cache/Cache.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index a512bf76ace..2c53706189a 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -585,8 +585,13 @@ class Cache implements ICache { return $cacheEntry->getPath(); }, $children); - $deletedIds = array_merge($deletedIds, $childIds); - $deletedPaths = array_merge($deletedPaths, $childPaths); + foreach ($childIds as $childId) { + $deletedIds[] = $childId; + } + + foreach ($childPaths as $childPath) { + $deletedPaths[] = $childPath; + } $query = $this->getQueryBuilder(); $query->delete('filecache_extended') |