]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(ExceptionSerializer): encode arguments before filtering the trace
authorJulius Härtl <jus@bitgrid.net>
Tue, 3 Jan 2023 18:24:00 +0000 (19:24 +0100)
committerJulius Härtl <jus@bitgrid.net>
Mon, 16 Jan 2023 08:47:31 +0000 (09:47 +0100)
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 <jus@bitgrid.net>
lib/private/Log/ExceptionSerializer.php

index aaf6a39235e0e4ee3f17f58e717074df92cbb3ac..5f806be0ae5bb6a7350dea0c2ec2f42d1a39c438 100644 (file)
@@ -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) {