mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
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:
parent
784b608691
commit
9ada2c63b9
10 changed files with 48 additions and 38 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue