From 61b8af39a9c38c83fbf56d3b650658f4d9cac024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Mizera?= <1938540+Axadiw@users.noreply.github.com> Date: Mon, 17 Aug 2020 20:14:26 +0200 Subject: [PATCH] Fixed multibyte characters division --- slack.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slack.php b/slack.php index 2069827..111cdbb 100644 --- a/slack.php +++ b/slack.php @@ -237,7 +237,7 @@ function format_text($text) { 'CONTROLEND' => '>' ]; // Replace the CONTROL characters, and limit text length to 500 characters. - return substr(str_replace(array_keys($moreformatter), array_values($moreformatter), $formatted_text), 0, 500); + return mb_substr(str_replace(array_keys($moreformatter), array_values($moreformatter), $formatted_text), 0, 500); } /**