diff options
author | Andrew Dolgov <[email protected]> | 2005-12-30 21:05:26 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2005-12-30 21:05:26 +0100 |
commit | 070d0d2a2ef8b8f1c6e1b646fa7f578733d366d7 (patch) | |
tree | 0fc2825e9eb21646f2d4fd7a7218f017905615cb /functions.php | |
parent | 1e18cf4b5a9cb96bd8edc78f0cbe098e6b8a1d28 (diff) |
remove headlines overflow hack, made truncate_string() utf-8 aware
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/functions.php b/functions.php index de5eb8a2e..f40ce7618 100644 --- a/functions.php +++ b/functions.php @@ -821,8 +821,8 @@ } function truncate_string($str, $max_len) { - if (strlen($str) > $max_len) { - return substr($str, 0, $max_len) . "..."; + if (mb_strlen($str) > $max_len - 3) { + return mb_substr($str, 0, $max_len) . "..."; } else { return $str; } |