Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PHP warnings in docker (Complement of #2316) #2318

Merged
merged 2 commits into from
Sep 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions scripts/pi-hole/php/update_checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,27 @@ function checkUpdate($currentVersion, $latestVersion)
$docker_latest = '';
}

$core_update = false;
$web_update = false;
$FTL_update = false;

// Version comparison
if (!$docker_current) {
// Not a docker container
if ($docker_current) {
// It's a container: do not check for individual component updates
if ($docker_current == 'nightly' || $docker_current == 'dev') {
// Special container - no update messages
$docker_update = false;
} else {
$docker_update = checkUpdate($docker_current, $docker_latest);
}
} else {
// Components comparison
$core_update = checkUpdate($core_current, $core_latest);
$web_update = checkUpdate($web_current, $web_latest);
$FTL_update = checkUpdate($FTL_current, $FTL_latest);

// Not a docker container
$docker_update = false;
} elseif ($docker_current == 'nightly' || $docker_current == 'dev') {
// Special container - no update messages
$docker_update = false;
} else {
$docker_update = checkUpdate($docker_current, $docker_latest);
}
}

Expand Down