Skip to content

Commit

Permalink
fix(ExceptionSerializer): encode arguments before filtering the trace
Browse files Browse the repository at this point in the history
This will avoid running into a Nesting level too deep error as the
encodeArg calls will limit potential recursive calls on the arguments to
a nesting level of 5

Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Jan 18, 2023
1 parent ae03129 commit a2073f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/private/Log/ExceptionSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,13 @@ private function removeValuesFromArgs($args, $values) {
}

private function encodeTrace($trace) {
$filteredTrace = $this->filterTrace($trace);
return array_map(function (array $line) {
$trace = array_map(function (array $line) {
if (isset($line['args'])) {
$line['args'] = array_map([$this, 'encodeArg'], $line['args']);
}
return $line;
}, $filteredTrace);
}, $trace);
return $this->filterTrace($trace);
}

private function encodeArg($arg, $nestingLevel = 5) {
Expand Down

0 comments on commit a2073f4

Please sign in to comment.