From f265f213731a20b21911003680dfa152a24ae5d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 29 Apr 2024 17:15:45 +0200 Subject: [PATCH] fix: Avoid reference use in AppConfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/AppConfig.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php index 338792e23d179..0732294abae57 100644 --- a/lib/private/AppConfig.php +++ b/lib/private/AppConfig.php @@ -850,11 +850,10 @@ private function setTypedValue( // update local cache if ($lazy) { - $cache = &$this->lazyCache; + $this->lazyCache[$app][$key] = $value; } else { - $cache = &$this->fastCache; + $this->fastCache[$app][$key] = $value; } - $cache[$app][$key] = $value; $this->valueTypes[$app][$key] = $type; return true; @@ -1264,11 +1263,10 @@ private function loadConfig(?bool $lazy = false): void { foreach ($rows as $row) { // most of the time, 'lazy' is not in the select because its value is already known if (($row['lazy'] ?? ($lazy ?? 0) ? 1 : 0) === 1) { - $cache = &$this->lazyCache; + $this->lazyCache[$row['appid']][$row['configkey']] = $row['configvalue'] ?? ''; } else { - $cache = &$this->fastCache; + $this->fastCache[$row['appid']][$row['configkey']] = $row['configvalue'] ?? ''; } - $cache[$row['appid']][$row['configkey']] = $row['configvalue'] ?? ''; $this->valueTypes[$row['appid']][$row['configkey']] = (int)($row['type'] ?? 0); } $result->closeCursor();