From: Joas Schilling Date: Fri, 8 Nov 2024 10:48:22 +0000 (+0100) Subject: fix(logger): Fix closure detection when filtering sensitive parameters X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8952a4cb77c94af3c707c873a0252e5e6cd2ef15;p=nextcloud-server.git fix(logger): Fix closure detection when filtering sensitive parameters Signed-off-by: Joas Schilling --- 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); } }