Skip to content

Commit 94af2fb

Browse files
authored
Merge pull request #1051 from enescakir/entity-strtolower
change lowercase function to mb_strtolower instead of strtolower
2 parents 28f54f2 + 9358997 commit 94af2fb

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
1616
### Fixed
1717
- Execution of `/start` command without any custom implementation.
1818
- Return `animation` type for GIF Message (which returns both `animation` and `document`). (#1044)
19+
- Change lowercase function to `mb_strtolower` from `strtolower` because of `latin-extented` characters. (#1051)
1920
### Security
2021

2122
## [0.61.1] - 2019-11-23

src/Entities/Entity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function getProperty($property, $default = null)
128128
public function __call($method, $args)
129129
{
130130
//Convert method to snake_case (which is the name of the property)
131-
$property_name = strtolower(ltrim(preg_replace('/[A-Z]/', '_$0', substr($method, 3)), '_'));
131+
$property_name = mb_strtolower(ltrim(preg_replace('/[A-Z]/', '_$0', substr($method, 3)), '_'));
132132

133133
$action = substr($method, 0, 3);
134134
if ($action === 'get') {

src/Telegram.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public function getCommandsList()
236236
foreach ($files as $file) {
237237
//Remove "Command.php" from filename
238238
$command = $this->sanitizeCommand(substr($file->getFilename(), 0, -11));
239-
$command_name = strtolower($command);
239+
$command_name = mb_strtolower($command);
240240

241241
if (array_key_exists($command_name, $commands)) {
242242
continue;
@@ -501,7 +501,7 @@ public function processUpdate(Update $update)
501501
*/
502502
public function executeCommand($command)
503503
{
504-
$command = strtolower($command);
504+
$command = mb_strtolower($command);
505505
$command_obj = $this->getCommandObject($command);
506506

507507
if (!$command_obj || !$command_obj->isEnabled()) {

0 commit comments

Comments
 (0)