Pony merda (#590)
* Update CallHandler.php * Update BotAPI.php * Update CallHandler.php * pony merda * Update BotAPI.php * Update BotAPI.php
This commit is contained in:
parent
169cfe2704
commit
d385e9383b
@ -398,7 +398,7 @@ trait CallHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($args)) {
|
if (is_array($args)) {
|
||||||
if (isset($args['message']) && is_string($args['message']) && $this->mb_strlen($args['message']) > $this->config['message_length_max']) {
|
if (isset($args['message']) && is_string($args['message']) && mb_strlen($args['message'], 'UTF-8') > $this->config['message_length_max']) {
|
||||||
$arg_chunks = $this->split_to_chunks($args);
|
$arg_chunks = $this->split_to_chunks($args);
|
||||||
$promises = [];
|
$promises = [];
|
||||||
$new_aargs = $aargs;
|
$new_aargs = $aargs;
|
||||||
|
@ -75,10 +75,10 @@ trait BotAPI
|
|||||||
|
|
||||||
public function mb_str_split($text, $length)
|
public function mb_str_split($text, $length)
|
||||||
{
|
{
|
||||||
$tlength = $this->mb_strlen($text);
|
$tlength = mb_strlen($text, 'UTF-8');
|
||||||
$result = [];
|
$result = [];
|
||||||
for ($x = 0; $x < $tlength; $x += $length) {
|
for ($x = 0; $x < $tlength; $x += $length) {
|
||||||
$result[] = $this->mb_substr($text, $x, $length);
|
$result[] = mb_substr($text, $x, $length, 'UTF-8');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
@ -537,7 +537,7 @@ trait BotAPI
|
|||||||
$max_length = isset($args['media']) ? $this->config['caption_length_max'] : $this->config['message_length_max'];
|
$max_length = isset($args['media']) ? $this->config['caption_length_max'] : $this->config['message_length_max'];
|
||||||
$text_arr = [];
|
$text_arr = [];
|
||||||
foreach ($this->multipleExplodeKeepDelimiters(["\n"], $args['message']) as $word) {
|
foreach ($this->multipleExplodeKeepDelimiters(["\n"], $args['message']) as $word) {
|
||||||
if ($this->mb_strlen($word) > $max_length) {
|
if (mb_strlen($word, 'UTF-8') > $max_length) {
|
||||||
foreach ($this->mb_str_split($word, $max_length) as $vv) {
|
foreach ($this->mb_str_split($word, $max_length) as $vv) {
|
||||||
$text_arr[] = $vv;
|
$text_arr[] = $vv;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user