mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-03 10:32:33 +00:00
Replace disallowed operators in tools/
This commit is contained in:
parent
9c328690f8
commit
4d55935bd8
@ -62,12 +62,12 @@ function find_regions_recursive(string $dir, array &$files) : void{
|
||||
return;
|
||||
}
|
||||
foreach($dirFiles as $file){
|
||||
if($file === "." or $file === ".."){
|
||||
if($file === "." || $file === ".."){
|
||||
continue;
|
||||
}
|
||||
$fullPath = $dir . "/" . $file;
|
||||
if(
|
||||
in_array(pathinfo($fullPath, PATHINFO_EXTENSION), SUPPORTED_EXTENSIONS, true) and
|
||||
in_array(pathinfo($fullPath, PATHINFO_EXTENSION), SUPPORTED_EXTENSIONS, true) &&
|
||||
is_file($fullPath)
|
||||
){
|
||||
$files[$fullPath] = filesize($fullPath);
|
||||
|
@ -59,7 +59,7 @@ if($inputPath === false){
|
||||
exit(1);
|
||||
}
|
||||
$backupPath = realpath($args["backup"]);
|
||||
if($backupPath === false || (!@mkdir($backupPath, 0777, true) and !is_dir($backupPath)) or !is_writable($backupPath)){
|
||||
if($backupPath === false || (!@mkdir($backupPath, 0777, true) && !is_dir($backupPath)) || !is_writable($backupPath)){
|
||||
fwrite(STDERR, "Backup file path " . $args["backup"] . " is not writable (permission error or doesn't exist), aborting" . PHP_EOL);
|
||||
exit(1);
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ function ping_server(\Socket $socket, string $serverIp, int $serverPort, int $ti
|
||||
\GlobalLogger::get()->error("Error reading from socket: " . socket_strerror(socket_last_error($socket)));
|
||||
return false;
|
||||
}
|
||||
if($recvAddr === $serverIp and $recvPort === $serverPort and $recvBuffer !== "" and ord($recvBuffer[0]) === MessageIdentifiers::ID_UNCONNECTED_PONG){
|
||||
if($recvAddr === $serverIp && $recvPort === $serverPort && $recvBuffer !== "" && ord($recvBuffer[0]) === MessageIdentifiers::ID_UNCONNECTED_PONG){
|
||||
$pong = new UnconnectedPong();
|
||||
$pong->decode(new PacketSerializer($recvBuffer));
|
||||
\GlobalLogger::get()->info("--- Response received ---");
|
||||
|
Loading…
x
Reference in New Issue
Block a user