Skip to content

Commit

Permalink
Dumper::truncateString() fixed for ''
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Nov 2, 2019
1 parent 6eb6784 commit ba95092
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Tracy/Dumper/Dumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -539,12 +539,13 @@ public static function truncateString(string $s, int $maxLength): string
$s = mb_substr($s, 0, $maxLength, 'UTF-8');
} else {
$i = $len = 0;
do {
while (isset($s[$i])) {
if (($s[$i] < "\x80" || $s[$i] >= "\xC0") && (++$len > $maxLength)) {
$s = substr($s, 0, $i);
break;
}
} while (isset($s[++$i]));
$i++;
}
}
return $s;
}
Expand Down

0 comments on commit ba95092

Please sign in to comment.