aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2024-11-08 11:48:22 +0100
committerJoas Schilling <coding@schilljs.com>2024-11-08 12:59:14 +0100
commit8952a4cb77c94af3c707c873a0252e5e6cd2ef15 (patch)
tree4ebddbf54ba79dcbd9aa989f108a5b9ac90099d9
parentda4fe3d5b7e8599fba696f0e9d531c9474faa6c0 (diff)
downloadnextcloud-server-8952a4cb77c94af3c707c873a0252e5e6cd2ef15.tar.gz
nextcloud-server-8952a4cb77c94af3c707c873a0252e5e6cd2ef15.zip
fix(logger): Fix closure detection when filtering sensitive parameters
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--lib/private/Log/ExceptionSerializer.php5
1 files changed, 4 insertions, 1 deletions
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);
}
}