From b58295daef40dcd0f9dd36e0266ca2be92a8d9a6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 5 Jan 2016 21:24:39 +0100 Subject: [PATCH] Fix alignment of long stack traces --- wcfsetup/install/files/lib/core.functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/core.functions.php b/wcfsetup/install/files/lib/core.functions.php index 75be10aaa9..e00eef70e7 100644 --- a/wcfsetup/install/files/lib/core.functions.php +++ b/wcfsetup/install/files/lib/core.functions.php @@ -263,7 +263,7 @@ namespace wcf\functions\exception { return max($carry, mb_strlen($item['file'].$item['line'])); }, 0) + 3; for ($i = 0, $max = count($trace); $i < $max; $i++) { - echo '#'.$i.' '.str_pad(StringUtil::encodeHTML($trace[$i]['file']).' ('.$trace[$i]['line'].')', $pathLength, ' ', STR_PAD_RIGHT).':'; + echo str_pad('#'.$i, strlen($max - 1) + 1, ' ', STR_PAD_RIGHT).' '.str_pad(StringUtil::encodeHTML($trace[$i]['file']).' ('.$trace[$i]['line'].')', $pathLength, ' ', STR_PAD_RIGHT).':'; echo ' '.$trace[$i]['class'].$trace[$i]['type'].$trace[$i]['function'].'('; echo implode(', ', array_map(function ($item) { switch (gettype($item)) { -- 2.20.1