PHP 5 fixes
This commit is contained in:
parent
dffe765edc
commit
5f7bf4c907
@ -31,7 +31,7 @@ trait CallHandler
|
|||||||
if (isset($args['id']['_']) && isset($args['id']['dc_id']) && $args['id']['_'] === 'inputBotInlineMessageID') {
|
if (isset($args['id']['_']) && isset($args['id']['dc_id']) && $args['id']['_'] === 'inputBotInlineMessageID') {
|
||||||
$aargs['datacenter'] = $args['id']['dc_id'];
|
$aargs['datacenter'] = $args['id']['dc_id'];
|
||||||
}
|
}
|
||||||
if (basename(debug_backtrace(0)[0]['file']) === 'APIFactory.php' && isset(self::DISALLOWED_METHODS[$method])) {
|
if (basename(debug_backtrace(0)[0]['file']) === 'APIFactory.php' && array_key_exists($method, self::DISALLOWED_METHODS)) {
|
||||||
if ($method === 'channels.getParticipants' && isset($args['filter']) && $args['filter'] === ['_' => 'channelParticipantsRecent']) {
|
if ($method === 'channels.getParticipants' && isset($args['filter']) && $args['filter'] === ['_' => 'channelParticipantsRecent']) {
|
||||||
\danog\MadelineProto\Logger::log([self::DISALLOWED_METHODS[$method]], \danog\MadelineProto\Logger::FATAL_ERROR);
|
\danog\MadelineProto\Logger::log([self::DISALLOWED_METHODS[$method]], \danog\MadelineProto\Logger::FATAL_ERROR);
|
||||||
} else {
|
} else {
|
||||||
|
@ -408,7 +408,8 @@ trait BotAPI
|
|||||||
$text = $this->html_entity_decode($node->textContent);
|
$text = $this->html_entity_decode($node->textContent);
|
||||||
$href = $node->getAttribute('href');
|
$href = $node->getAttribute('href');
|
||||||
if (preg_match('|mention:|', $href)) {
|
if (preg_match('|mention:|', $href)) {
|
||||||
if (!isset(($mention = $this->get_info(str_replace('mention:', '', $href)))['InputUser'])) {
|
$mention = $this->get_info(str_replace('mention:', '', $href));
|
||||||
|
if (!isset($mention['InputUser'])) {
|
||||||
throw new \danog\MadelineProto\Exception('This peer is not present in the internal peer database');
|
throw new \danog\MadelineProto\Exception('This peer is not present in the internal peer database');
|
||||||
}
|
}
|
||||||
$entities[] = ['_' => 'inputMessageEntityMentionName', 'offset' => mb_strlen($nmessage), 'length' => mb_strlen($text), 'user_id' => $mention['InputUser']];
|
$entities[] = ['_' => 'inputMessageEntityMentionName', 'offset' => mb_strlen($nmessage), 'length' => mb_strlen($text), 'user_id' => $mention['InputUser']];
|
||||||
|
Loading…
Reference in New Issue
Block a user