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:
davtur19 2019-03-11 23:45:48 +01:00 committed by Daniil Gentili
parent 169cfe2704
commit d385e9383b
2 changed files with 4 additions and 4 deletions

View File

@ -398,7 +398,7 @@ trait CallHandler
}
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);
$promises = [];
$new_aargs = $aargs;

View File

@ -75,10 +75,10 @@ trait BotAPI
public function mb_str_split($text, $length)
{
$tlength = $this->mb_strlen($text);
$tlength = mb_strlen($text, 'UTF-8');
$result = [];
for ($x = 0; $x < $tlength; $x += $length) {
$result[] = $this->mb_substr($text, $x, $length);
$result[] = mb_substr($text, $x, $length, 'UTF-8');
}
return $result;
@ -537,7 +537,7 @@ trait BotAPI
$max_length = isset($args['media']) ? $this->config['caption_length_max'] : $this->config['message_length_max'];
$text_arr = [];
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) {
$text_arr[] = $vv;
}