From 8952a4cb77c94af3c707c873a0252e5e6cd2ef15 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 8 Nov 2024 11:48:22 +0100 Subject: [PATCH] fix(logger): Fix closure detection when filtering sensitive parameters Signed-off-by: Joas Schilling --- lib/private/Log/ExceptionSerializer.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/private/Log/ExceptionSerializer.php b/lib/private/Log/ExceptionSerializer.php index 904107f6998..6d94bf51f45 100644 --- a/lib/private/Log/ExceptionSerializer.php +++ b/lib/private/Log/ExceptionSerializer.php @@ -34,6 +34,7 @@ class ExceptionSerializer { 'validateUserPass', 'loginWithToken', '{closure}', + '{closure:*', 'createSessionToken', // Provisioning @@ -200,7 +201,9 @@ class ExceptionSerializer { return $this->editTrace($sensitiveValues, $traceLine); } foreach (self::methodsWithSensitiveParameters as $sensitiveMethod) { - if (str_contains($traceLine['function'], $sensitiveMethod)) { + if (str_contains($traceLine['function'], $sensitiveMethod) + || (str_ends_with($sensitiveMethod, '*') + && str_starts_with($traceLine['function'], substr($sensitiveMethod, 0, -1)))) { return $this->editTrace($sensitiveValues, $traceLine); } } -- 2.39.5