Merge branch 'stable'

This commit is contained in:
Dylan K. Taylor
2021-11-01 18:13:24 +00:00
13 changed files with 1640 additions and 1511 deletions

View File

@@ -86,7 +86,9 @@ abstract class Timezone{
if(($response = Internet::getURL("http://ip-api.com/json")) !== null //If system timezone detection fails or timezone is an invalid value.
and is_array($ip_geolocation_data = json_decode($response->getBody(), true))
and isset($ip_geolocation_data['status'])
and $ip_geolocation_data['status'] !== 'fail'
and is_string($ip_geolocation_data['timezone'])
and date_default_timezone_set($ip_geolocation_data['timezone'])
){
//Again, for redundancy.

View File

@@ -71,6 +71,7 @@ use function preg_grep;
use function preg_match;
use function preg_match_all;
use function preg_replace;
use function shell_exec;
use function spl_object_id;
use function str_pad;
use function str_split;
@@ -233,7 +234,7 @@ final class Utils{
}elseif($os === Utils::OS_ANDROID){
$machine .= @file_get_contents("/system/build.prop");
}elseif($os === Utils::OS_MACOS){
$machine .= `system_profiler SPHardwareDataType | grep UUID`;
$machine .= shell_exec("system_profiler SPHardwareDataType | grep UUID");
}
$data = $machine . PHP_MAXPATHLEN;
$data .= PHP_INT_MAX;
@@ -316,7 +317,7 @@ final class Utils{
break;
case Utils::OS_BSD:
case Utils::OS_MACOS:
$processors = (int) `sysctl -n hw.ncpu`;
$processors = (int) shell_exec("sysctl -n hw.ncpu");
break;
case Utils::OS_WINDOWS:
$processors = (int) getenv("NUMBER_OF_PROCESSORS");