diff options
author | sgiehl <stefan@matomo.org> | 2020-04-28 15:19:56 +0300 |
---|---|---|
committer | sgiehl <stefan@matomo.org> | 2020-04-28 15:19:56 +0300 |
commit | bed0c2659e174b9697ab30556b43e79dcea24ca3 (patch) | |
tree | a857a5110c492a0227088c1291509dfb489a2e9b /core/CronArchive.php | |
parent | 69a65613e645cbd153221ca1bbdd5d9d0e2b08b4 (diff) | |
parent | 1534367810d12bc9f50571d1dde02b153dae0d6a (diff) |
Merge branch '3.x-dev' into 4.x-dev
Diffstat (limited to 'core/CronArchive.php')
-rw-r--r-- | core/CronArchive.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/CronArchive.php b/core/CronArchive.php index a9a0a3839e..9413e9d179 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -1240,8 +1240,13 @@ class CronArchive public function logError($m) { if (!defined('PIWIK_ARCHIVE_NO_TRUNCATE')) { - $m = substr($m, 0, self::TRUNCATE_ERROR_MESSAGE_SUMMARY); $m = str_replace(array("\n", "\t"), " ", $m); + if (Common::mb_strlen($m) > self::TRUNCATE_ERROR_MESSAGE_SUMMARY) { + $numCharactersKeepFromEnd = 100; + $m = Common::mb_substr($m, 0, self::TRUNCATE_ERROR_MESSAGE_SUMMARY - $numCharactersKeepFromEnd) + . ' ... ' . + Common::mb_substr($m, -1 * $numCharactersKeepFromEnd); + } } $this->errors[] = $m; $this->logger->error($m); |