Merge pull request #10284 from nextcloud/exceptionserializer-isset

make exception serializer a bit more robust
This commit is contained in:
Roeland Jago Douma 2018-07-18 17:55:45 +02:00 committed by GitHub
commit 844c740868
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,7 +82,9 @@ class ExceptionSerializer {
return $traceLine;
}, $trace);
return array_map(function (array $traceLine) use ($sensitiveValues) {
if (isset($traceLine['args'])) {
$traceLine['args'] = $this->removeValuesFromArgs($traceLine['args'], $sensitiveValues);
}
return $traceLine;
}, $trace);
}
@ -101,7 +103,9 @@ class ExceptionSerializer {
private function encodeTrace($trace) {
$filteredTrace = $this->filterTrace($trace);
return array_map(function (array $line) {
if (isset($line['args'])) {
$line['args'] = array_map([$this, 'encodeArg'], $line['args']);
}
return $line;
}, $filteredTrace);
}