Merge pull request #48830 from nextcloud/backport/48603/stable30

[stable30] fix(logger): Remove more parameters of other methods
This commit is contained in:
Joas Schilling 2024-10-22 08:43:59 +02:00 committed by GitHub
commit 06c1328ce7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,6 +6,7 @@
namespace OC\Log;
use OC\Core\Controller\SetupController;
use OC\Http\Client\Client;
use OC\Security\IdentityProof\Key;
use OC\Setup;
use OC\SystemConfig;
@ -106,6 +107,22 @@ class ExceptionSerializer {
Key::class => [
'__construct'
],
Client::class => [
'request',
'delete',
'deleteAsync',
'get',
'getAsync',
'head',
'headAsync',
'options',
'optionsAsync',
'patch',
'post',
'postAsync',
'put',
'putAsync',
],
\Redis::class => [
'auth'
],
@ -196,13 +213,13 @@ class ExceptionSerializer {
private function removeValuesFromArgs($args, $values): array {
$workArgs = [];
foreach ($args as $arg) {
foreach ($args as $key => $arg) {
if (in_array($arg, $values, true)) {
$arg = self::SENSITIVE_VALUE_PLACEHOLDER;
} elseif (is_array($arg)) {
$arg = $this->removeValuesFromArgs($arg, $values);
}
$workArgs[] = $arg;
$workArgs[$key] = $arg;
}
return $workArgs;
}