mirror of
https://github.com/librespeed/speedtest.git
synced 2026-05-13 08:16:36 +00:00
Fix PHP version check for geoip2.phar compatibility (#754)
* Initial plan * Fix PHP version check to require PHP 8.1.0+ for geoip2.phar Changed from PHP_MAJOR_VERSION >= 8 to PHP_VERSION_ID >= 80100 to match the actual requirement of geoip2.phar which needs PHP 8.1.0 or higher. This prevents HTTP 500 errors on PHP 8.0.x installations. Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>
This commit is contained in:
parent
85d3dd05dc
commit
734a35f89c
1 changed files with 2 additions and 2 deletions
|
|
@ -134,11 +134,11 @@ function getIspInfo_ipinfoApi($ip){
|
|||
]);
|
||||
}
|
||||
|
||||
if (PHP_MAJOR_VERSION >= 8){
|
||||
if (PHP_VERSION_ID >= 80100){
|
||||
require_once("geoip2.phar");
|
||||
}
|
||||
function getIspInfo_ipinfoOfflineDb($ip){
|
||||
if (PHP_MAJOR_VERSION < 8 || !file_exists(OFFLINE_IPINFO_DB_FILE) || !is_readable(OFFLINE_IPINFO_DB_FILE)){
|
||||
if (PHP_VERSION_ID < 80100 || !file_exists(OFFLINE_IPINFO_DB_FILE) || !is_readable(OFFLINE_IPINFO_DB_FILE)){
|
||||
return null;
|
||||
}
|
||||
$reader = new MaxMind\Db\Reader(OFFLINE_IPINFO_DB_FILE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue