Skip to content

Commit

Permalink
Add test to avoid "Undefined Variable" warnings
Browse files Browse the repository at this point in the history
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
  • Loading branch information
rdwebdesign committed Aug 28, 2022
1 parent ce8045b commit c5b47b8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/pi-hole/php/update_checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,19 @@ function checkUpdate($currentVersion, $latestVersion)
$core_latest = $versions['GITHUB_CORE_VERSION'];
$web_latest = $versions['GITHUB_WEB_VERSION'];
$FTL_latest = $versions['GITHUB_FTL_VERSION'];
$docker_latest = $versions['GITHUB_DOCKER_VERSION'];
if (isset($versions['GITHUB_DOCKER_VERSION'])) {
$docker_latest = $versions['GITHUB_DOCKER_VERSION'];
} else {
$docker_latest = "";
}

// Version comparison
if (!$docker_current) {
// Not a docker container
$core_update = checkUpdate($core_current, $core_latest);
$web_update = checkUpdate($web_current, $web_latest);
$FTL_update = checkUpdate($FTL_current, $FTL_latest);
$docker_update = false;
} elseif ($docker_current == 'nightly' || $docker_current == 'dev') {
// Special container - no update messages
$docker_update = false;
Expand Down

0 comments on commit c5b47b8

Please sign in to comment.