From 7daa20d3095cbf99abebfe23fb307fff9d1e5fbb Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Tue, 3 Jan 2023 19:24:00 +0100 Subject: fix(ExceptionSerializer): encode arguments before filtering the trace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- lib/private/Log/ExceptionSerializer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/private/Log') diff --git a/lib/private/Log/ExceptionSerializer.php b/lib/private/Log/ExceptionSerializer.php index aaf6a39235e..5f806be0ae5 100644 --- a/lib/private/Log/ExceptionSerializer.php +++ b/lib/private/Log/ExceptionSerializer.php @@ -223,13 +223,13 @@ class ExceptionSerializer { } 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) { -- cgit v1.2.3