From cc43e19b44bd702be93c2244d1ae81a0cb14c69f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 17 Feb 2016 16:42:13 +0300 Subject: error handler: do not log last query, truncate error message to a smaller length --- include/functions.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/functions.php') 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 { -- cgit v1.2.3-54-g00ecf