diff options
-rw-r--r-- | lib/private/Collaboration/Reference/ReferenceManager.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/Collaboration/Reference/ReferenceManager.php b/lib/private/Collaboration/Reference/ReferenceManager.php index 52f09d3a879..2897410f5d6 100644 --- a/lib/private/Collaboration/Reference/ReferenceManager.php +++ b/lib/private/Collaboration/Reference/ReferenceManager.php @@ -269,12 +269,13 @@ class ReferenceManager implements IReferenceManager { } $userId = $user->getUID(); $keys = $this->config->getUserKeys($userId, 'references'); - $keys = array_filter($keys, static function (string $key) { - return preg_match('/^provider-last-use_/', $key) !== false; + $prefix = 'provider-last-use_'; + $keys = array_filter($keys, static function (string $key) use ($prefix) { + return str_starts_with($key, $prefix); }); $timestamps = []; foreach ($keys as $key) { - $providerId = preg_replace('/^provider-last-use_/', '', $key); + $providerId = substr($key, strlen($prefix)); $timestamp = (int) $this->config->getUserValue($userId, 'references', $key); $timestamps[$providerId] = $timestamp; } |