summaryrefslogtreecommitdiff
path: root/include/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2016-02-17 16:42:13 +0300
committerAndrew Dolgov <[email protected]>2016-02-17 16:42:13 +0300
commitcc43e19b44bd702be93c2244d1ae81a0cb14c69f (patch)
tree06dbb601ecfe87e026ecf41a80d996344ca3f03b /include/functions.php
parent1003f71e0459b4b5e7d5e7b393d0baba02e82808 (diff)
error handler: do not log last query, truncate error message to a smaller length
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 = '&hellip;') {
+ 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 {