Merge branch 'stable' into next-minor

This commit is contained in:
Dylan K. Taylor
2022-04-19 15:27:55 +01:00
7 changed files with 59 additions and 28 deletions

View File

@ -132,6 +132,7 @@ use function get_class;
use function ini_set;
use function is_array;
use function is_dir;
use function is_object;
use function is_resource;
use function is_string;
use function json_decode;
@ -1617,7 +1618,7 @@ class Server{
"reportPaste" => base64_encode($dump->getEncodedData())
], 10, [], $postUrlError);
if($reply !== null && ($data = json_decode($reply->getBody())) !== null){
if($reply !== null && is_object($data = json_decode($reply->getBody()))){
if(isset($data->crashId) && isset($data->crashUrl)){
$reportId = $data->crashId;
$reportUrl = $data->crashUrl;

View File

@ -125,6 +125,7 @@ use function get_class;
use function in_array;
use function json_encode;
use function ksort;
use function strcasecmp;
use function strlen;
use function strtolower;
use function substr;
@ -635,7 +636,7 @@ class NetworkSession{
continue;
}
$info = $existingSession->getPlayerInfo();
if($info !== null && ($info->getUsername() === $this->info->getUsername() || $info->getUuid()->equals($this->info->getUuid()))){
if($info !== null && (strcasecmp($info->getUsername(), $this->info->getUsername()) === 0 || $info->getUuid()->equals($this->info->getUuid()))){
if($kickForXUIDMismatch($info instanceof XboxLivePlayerInfo ? $info->getXuid() : "")){
return;
}

View File

@ -64,6 +64,13 @@ class ZippedResourcePack implements ResourcePack{
if(!file_exists($zipPath)){
throw new ResourcePackException("File not found");
}
$size = filesize($zipPath);
if($size === false){
throw new ResourcePackException("Unable to determine size of file");
}
if($size === 0){
throw new ResourcePackException("Empty file, probably corrupted");
}
$archive = new \ZipArchive();
if(($openResult = $archive->open($zipPath)) !== true){