mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Use str_starts_with and str_contains instead of strpos (#5482)
This commit is contained in:
@ -125,8 +125,8 @@ use function mb_strlen;
|
||||
use function microtime;
|
||||
use function preg_match;
|
||||
use function sprintf;
|
||||
use function str_starts_with;
|
||||
use function strlen;
|
||||
use function strpos;
|
||||
use function substr;
|
||||
use function trim;
|
||||
use const JSON_THROW_ON_ERROR;
|
||||
@ -726,7 +726,7 @@ class InGamePacketHandler extends PacketHandler{
|
||||
}
|
||||
|
||||
public function handleCommandRequest(CommandRequestPacket $packet) : bool{
|
||||
if(strpos($packet->command, '/') === 0){
|
||||
if(str_starts_with($packet->command, '/')){
|
||||
$this->player->chat($packet->command);
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user