Skip to content

apply mb_strtolower to command_name in processUpdate #1198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

alpipego
Copy link

Keys in \Longman\TelegramBot\Telegram::$commands_objects get register as all lowercase, but not queried the same way. Apply mb_strtolower to $command_tmp in \Longman\TelegramBot\Telegram::processUpdate to short circuit \Longman\TelegramBot\Telegram::getCommandObject.

fixes #1197

Obviously, there are many ways to apply mb_strtolower here, this could also be done in \Longman\TelegramBot\Telegram::getCommandObject as the first statement. This is how I did it, to patch my local installation.

Keys in `\Longman\TelegramBot\Telegram::$commands_objects` get register as all lowercase, but not queried the same way. Apply `mb_strtolower` to `$command_tmp` in `\Longman\TelegramBot\Telegram::processUpdate` to short circuit `\Longman\TelegramBot\Telegram::getCommandObject`. 

fixes php-telegram-bot#1197
@noplanman
Copy link
Member

Closed, as implemented in #1207 and #1209

@noplanman noplanman closed this Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command key incorrect capitalization in \Longman\TelegramBot\Telegram::$commands_objects
2 participants