mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-16 08:35:57 +00:00
truncate_string() now actually is utf-8 compatible
This commit is contained in:
@@ -821,8 +821,8 @@
|
||||
}
|
||||
|
||||
function truncate_string($str, $max_len) {
|
||||
if (mb_strlen($str) > $max_len - 3) {
|
||||
return mb_substr($str, 0, $max_len) . "...";
|
||||
if (mb_strlen($str, "utf-8") > $max_len - 3) {
|
||||
return mb_substr($str, 0, $max_len, "utf-8") . "...";
|
||||
} else {
|
||||
return $str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user