summaryrefslogtreecommitdiff
path: root/include/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions.php')
-rwxr-xr-xinclude/functions.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/functions.php b/include/functions.php
index b558b0e6c..d43943966 100755
--- a/include/functions.php
+++ b/include/functions.php
@@ -878,6 +878,15 @@
}
}
+ // is not utf8 clean
+ function truncate_middle($str, $max_len, $suffix = '…') {
+ if (strlen($str) > $max_len) {
+ return substr_replace($str, $suffix, $max_len / 2, mb_strlen($str) - $max_len);
+ } else {
+ return $str;
+ }
+ }
+
function convert_timestamp($timestamp, $source_tz, $dest_tz) {
try {