Fix alignment of long stack traces
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 5 Jan 2016 20:24:39 +0000 (21:24 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 5 Jan 2016 20:24:39 +0000 (21:24 +0100)
wcfsetup/install/files/lib/core.functions.php

index 75be10aaa9c3d0c45cd0cbdc39f962e5d095b89d..e00eef70e75e9e93b2ee70c571deb1f58c1ea3c1 100644 (file)
@@ -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)) {