parse_mode fixes
This commit is contained in:
parent
0675fba227
commit
40857b705e
@ -439,7 +439,7 @@ trait BotAPI
|
||||
|
||||
public function parse_mode($arguments)
|
||||
{
|
||||
if ($arguments['message'] === '' || !isset($arguments['message'])) {
|
||||
if ($arguments['message'] === '' || !isset($arguments['message']) || !isset($arguments['parse_mode'])) {
|
||||
return $arguments;
|
||||
}
|
||||
if (isset($arguments['parse_mode']['_'])) {
|
||||
@ -479,6 +479,7 @@ trait BotAPI
|
||||
public function split_to_chunks($args)
|
||||
{
|
||||
$args = $this->parse_mode($args);
|
||||
if (!isset($args['entities'])) $args['entities'] = [];
|
||||
|
||||
$multiple_args_base = array_merge($args, ['entities' => [], 'parse_mode' => 'text', 'message' => '']);
|
||||
$multiple_args = [$multiple_args_base];
|
||||
@ -543,9 +544,9 @@ trait BotAPI
|
||||
$delimOffset = 0;
|
||||
foreach ($initialArray as $item) {
|
||||
$delimOffset += $this->mb_strlen($item);
|
||||
if ($this->mb_strlen($item) > 0) {
|
||||
//if ($this->mb_strlen($item) > 0) {
|
||||
$finalArray[] = $item.($delimOffset < $this->mb_strlen($string) ? $string[$delimOffset] : '');
|
||||
}
|
||||
//}
|
||||
$delimOffset++;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user