mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-11 00:09:39 +00:00
Registry Trait: fixed magic methods not working properly when system locale is tr_TR (#3580)
Fixed incorrect case of incorrect letters on operating systems using languages other than English. Like (Stair => STAİR)
This commit is contained in:
parent
5f0f5236f8
commit
5f79071e4c
@ -30,7 +30,7 @@ use function implode;
|
||||
use function sprintf;
|
||||
use function strlen;
|
||||
use function strpos;
|
||||
use function strtoupper;
|
||||
use function mb_strtoupper;
|
||||
use function substr;
|
||||
|
||||
trait RegistryTrait{
|
||||
@ -43,11 +43,11 @@ trait RegistryTrait{
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
private static function _registryRegister(string $name, object $member) : void{
|
||||
$name = strtoupper($name);
|
||||
$name = mb_strtoupper($name);
|
||||
if(isset(self::$members[$name])){
|
||||
throw new \InvalidArgumentException("\"$name\" is already reserved");
|
||||
}
|
||||
self::$members[strtoupper($name)] = $member;
|
||||
self::$members[mb_strtoupper($name)] = $member;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -74,7 +74,7 @@ trait RegistryTrait{
|
||||
*/
|
||||
private static function _registryFromString(string $name) : object{
|
||||
self::checkInit();
|
||||
$name = strtoupper($name);
|
||||
$name = mb_strtoupper($name);
|
||||
if(!isset(self::$members[$name])){
|
||||
throw new \InvalidArgumentException("No such registry member: " . self::class . "::" . $name);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user