Minor improvements (#1480)

* Some enhancements for updates checker

* Updated

* Update updater.php

* Update init_bb.php

* Update CHANGELOG.md

* Update globals.css

* Updated

* Update functions.php

* Update init_bb.php

* Updated

* Updated

* Updated

* Update update_geolite_db.php

* Update update_geolite_db.php

* Update update_geolite_db.php

* Updated

* Update .gitignore

* Update init_bb.php

* Updated

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-05-11 00:44:35 +07:00 committed by GitHub
commit 9ada2c63b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 48 additions and 38 deletions

View file

@ -2148,22 +2148,21 @@ function getBanInfo(int $userId = null): ?array
*/
function readUpdaterFile(): array|bool
{
$str = [];
if (!is_file(UPDATER_FILE)) {
return false;
}
$str = [];
if ($updaterFile = fopen(UPDATER_FILE, 'r')) {
while (!feof($updaterFile)) {
$str[] = trim(fgets($updaterFile));
}
}
if (!empty($str)) {
return [
'previous_version' => (int)$str[0],
'latest_version' => (int)$str[1],
];
}
return false;
return [
'previous_version' => is_numeric($str[0]) ? (int)$str[0] : 0,
'latest_version' => is_numeric($str[1]) ? (int)$str[1] : 0
];
}
/**
@ -2173,7 +2172,7 @@ function readUpdaterFile(): array|bool
* @param int $port
* @return mixed|string|null
*/
function countryByIP(string $ipAddress, int $port = 1111): mixed
function getCountryByIP(string $ipAddress, int $port = 1111): mixed
{
global $lang;