Merge remote-tracking branch 'origin/stable' into master

# Conflicts:
#	composer.json
#	composer.lock
#	src/CrashDump.php
#	src/pocketmine/Server.php
#	src/pocketmine/level/format/io/region/McRegion.php
#	tests/phpstan/configs/check-explicit-mixed-baseline.neon
#	tests/phpstan/configs/l7-baseline.neon
#	tests/phpstan/configs/l8-baseline.neon
#	tests/travis/setup-php.yml
This commit is contained in:
Dylan K. Taylor
2020-10-26 16:18:53 +00:00
11 changed files with 325 additions and 333 deletions

View File

@ -62,7 +62,8 @@ abstract class RegionWorldProvider extends BaseWorldProvider{
public static function isValid(string $path) : bool{
if(file_exists($path . "/level.dat") and is_dir($path . "/region/")){
foreach(scandir($path . "/region/", SCANDIR_SORT_NONE) as $file){
if(substr($file, strrpos($file, ".") + 1) === static::getRegionFileExtension()){
$extPos = strrpos($file, ".");
if($extPos !== false && substr($file, $extPos + 1) === static::getRegionFileExtension()){
//we don't care if other region types exist, we only care if this format is possible
return true;
}