Mercurial > hg > fapweb
diff msitegen.inc.php @ 558:09a11dd385c7
Add new function stStrChopPad() that replaces stStrChop(), but stStrChop()
works differently now.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 22 Dec 2013 08:03:51 +0200 |
parents | 1fceb6f57c90 |
children | 67c6bde8d265 |
line wrap: on
line diff
--- a/msitegen.inc.php Sat Dec 21 08:10:29 2013 +0200 +++ b/msitegen.inc.php Sun Dec 22 08:03:51 2013 +0200 @@ -641,11 +641,13 @@ function stStrChop($str, $len) { - if (strlen($str) > $len) - $s = substr($str, 0, $len - 3)."..."; - else - $s = $str; - return sprintf("%-".$len."s", $s); + return (strlen($str) > $len) ? substr($str, 0, $len - 3)."..." : $str; +} + + +function stStrChopPad($str, $len) +{ + return sprintf("%-".$len."s", stStrChop($str, $len)); }