diff --git a/src/CrashDump.php b/src/CrashDump.php index bd97b3595..469b3e4b8 100644 --- a/src/CrashDump.php +++ b/src/CrashDump.php @@ -47,6 +47,7 @@ use function is_resource; use function json_encode; use function json_last_error_msg; use function max; +use function mb_strtoupper; use function mkdir; use function ob_end_clean; use function ob_get_contents; @@ -57,7 +58,6 @@ use function phpversion; use function preg_replace; use function str_split; use function strpos; -use function strtoupper; use function substr; use function time; use function zend_version; @@ -172,7 +172,7 @@ class CrashDump{ "depends" => $d->getDepend(), "softDepends" => $d->getSoftDepend(), "main" => $d->getMain(), - "load" => strtoupper($d->getOrder()->name()), + "load" => mb_strtoupper($d->getOrder()->name()), "website" => $d->getWebsite() ]; $this->addLine($d->getName() . " " . $d->getVersion() . " by " . implode(", ", $d->getAuthors()) . " for API(s) " . implode(", ", $d->getCompatibleApis())); diff --git a/src/MemoryManager.php b/src/MemoryManager.php index 137bd5d95..90acbc939 100644 --- a/src/MemoryManager.php +++ b/src/MemoryManager.php @@ -50,6 +50,7 @@ use function is_object; use function is_resource; use function is_string; use function json_encode; +use function mb_strtoupper; use function min; use function mkdir; use function preg_match; @@ -58,7 +59,6 @@ use function round; use function spl_object_hash; use function sprintf; use function strlen; -use function strtoupper; use function substr; use const JSON_PRETTY_PRINT; use const JSON_UNESCAPED_SLASHES; @@ -131,7 +131,7 @@ class MemoryManager{ if($m <= 0){ $defaultMemory = 0; }else{ - switch(strtoupper($matches[2])){ + switch(mb_strtoupper($matches[2])){ case "K": $defaultMemory = $m / 1024; break; diff --git a/src/event/EventPriority.php b/src/event/EventPriority.php index bcb914324..fc52d99c2 100644 --- a/src/event/EventPriority.php +++ b/src/event/EventPriority.php @@ -25,7 +25,7 @@ namespace pocketmine\event; use function constant; use function defined; -use function strtoupper; +use function mb_strtoupper; /** * List of event priorities @@ -84,7 +84,7 @@ final class EventPriority{ * @throws \InvalidArgumentException */ public static function fromString(string $name) : int{ - $name = strtoupper($name); + $name = mb_strtoupper($name); $const = self::class . "::" . $name; if($name !== "ALL" and defined($const)){ return constant($const); diff --git a/src/item/enchantment/Enchantment.php b/src/item/enchantment/Enchantment.php index 80e791605..313a88d84 100644 --- a/src/item/enchantment/Enchantment.php +++ b/src/item/enchantment/Enchantment.php @@ -26,7 +26,7 @@ namespace pocketmine\item\enchantment; use pocketmine\event\entity\EntityDamageEvent; use function constant; use function defined; -use function strtoupper; +use function mb_strtoupper; /** * Manages enchantment type data. @@ -233,7 +233,7 @@ class Enchantment{ } public static function fromString(string $name) : ?Enchantment{ - $const = Enchantment::class . "::" . strtoupper($name); + $const = Enchantment::class . "::" . mb_strtoupper($name); if(defined($const)){ return self::get(constant($const)); }