From a2073f4d4dccf33c75d4127e3d13491a10a279c3 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') diff --git a/lib/private/Log/ExceptionSerializer.php b/lib/private/Log/ExceptionSerializer.php index 0758e48197a..975b517249e 100644 --- a/lib/private/Log/ExceptionSerializer.php +++ b/lib/private/Log/ExceptionSerializer.php @@ -228,13 +228,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