From 873535f719b51b9efca4771efa6f046d7e1c9160 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 9 Oct 2020 17:23:22 +0100 Subject: [PATCH] Timezone: explicitly check result of getURL() phpstan-strict-rules should report this, but it doesn't ... --- src/pocketmine/utils/Timezone.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/utils/Timezone.php b/src/pocketmine/utils/Timezone.php index 02c1ab9d4..8d883e582 100644 --- a/src/pocketmine/utils/Timezone.php +++ b/src/pocketmine/utils/Timezone.php @@ -88,7 +88,7 @@ abstract class Timezone{ break; } - if($response = Internet::getURL("http://ip-api.com/json") //If system timezone detection fails or timezone is an invalid value. + if(($response = Internet::getURL("http://ip-api.com/json")) !== false //If system timezone detection fails or timezone is an invalid value. and $ip_geolocation_data = json_decode($response, true) and $ip_geolocation_data['status'] !== 'fail' and date_default_timezone_set($ip_geolocation_data['timezone'])