mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Minor improvements (#1490)
* Minor improvements * Update CHANGELOG.md * Update functions.php * Update build_check_updates.php * Update index.php * Updated
This commit is contained in:
parent
33720fb284
commit
3db9095b78
6 changed files with 43 additions and 30 deletions
|
@ -2152,16 +2152,17 @@ function readUpdaterFile(): array|bool
|
|||
return false;
|
||||
}
|
||||
|
||||
$str = [];
|
||||
if ($updaterFile = fopen(UPDATER_FILE, 'r')) {
|
||||
while (!feof($updaterFile)) {
|
||||
$str[] = trim(fgets($updaterFile));
|
||||
}
|
||||
$updaterFile = new SplFileObject(UPDATER_FILE, 'r');
|
||||
$updaterFile->setFlags(SplFileObject::SKIP_EMPTY | SplFileObject::DROP_NEW_LINE);
|
||||
|
||||
$lines = [];
|
||||
foreach ($updaterFile as $line) {
|
||||
$lines[] = is_numeric($line) ? (int)$line : 0;
|
||||
}
|
||||
|
||||
return [
|
||||
'previous_version' => is_numeric($str[0]) ? (int)$str[0] : 0,
|
||||
'latest_version' => is_numeric($str[1]) ? (int)$str[1] : 0
|
||||
'previous_version' => $lines[0],
|
||||
'latest_version' => $lines[1]
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue