Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(ExceptionSerializer): encode arguments before filtering the trace
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
commit 41cc0bb190d8b8e6be5bb86e4ccaf6feb0a3c3bc
6 changes: 3 additions & 3 deletions lib/private/Log/ExceptionSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,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