From: Tim Düsterhus Date: Tue, 5 Jan 2016 20:24:39 +0000 (+0100) Subject: Fix alignment of long stack traces X-Git-Tag: 3.0.0_Beta_1~2067 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b58295daef40dcd0f9dd36e0266ca2be92a8d9a6;p=GitHub%2FWoltLab%2FWCF.git Fix alignment of long stack traces --- 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)) {