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 warninigs + Show Docker tag for nightly and dev #2330

Merged
merged 1 commit into from
Sep 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 10 additions & 9 deletions scripts/pi-hole/php/update_checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ function checkUpdate($currentVersion, $latestVersion)
$docker_update = false;
} else {
$docker_update = checkUpdate($docker_current, $docker_latest);

$dockerUrl = 'https://github.com/pi-hole/docker-pi-hole/releases';
$dockerVersionStr = '<a href="'.$dockerUrl.'/'.$docker_current.'" rel="noopener" target="_blank">'.$docker_current.'</a>';
}
} else {
// Components comparison
Expand All @@ -102,26 +99,30 @@ function checkUpdate($currentVersion, $latestVersion)
$coreUrl = 'https://github.com/pi-hole/pi-hole/releases';
$webUrl = 'https://github.com/pi-hole/AdminLTE/releases';
$ftlUrl = 'https://github.com/pi-hole/FTL/releases';
$dockerUrl = 'https://github.com/pi-hole/docker-pi-hole/releases';

// Version strings
// If "vDev" show branch/commit, else show link
$coreVersionStr = $core_current;
if (isset($core_commit)) {
$coreVersionStr .= ' ('.$core_branch.', '.$core_commit.')';
$coreVersionStr = $core_current.' ('.$core_branch.', '.$core_commit.')';
} else {
$coreVersionStr = '<a href="'.$coreUrl.'/'.$core_current.'" rel="noopener" target="_blank">'.$core_current.'</a>';
}

$webVersionStr = $web_current;
if (isset($web_commit)) {
$webVersionStr .= ' ('.$web_branch.', '.$web_commit.')';
$webVersionStr = $web_current.' ('.$web_branch.', '.$web_commit.')';
} else {
$webVersionStr = '<a href="'.$webUrl.'/'.$web_current.'" rel="noopener" target="_blank">'.$web_current.'</a>';
}

$ftlVersionStr = $FTL_current;
if (isset($FTL_commit)) {
$ftlVersionStr .= ' ('.$FTL_branch.', '.$FTL_commit.')';
$ftlVersionStr = $FTL_current.' ('.$FTL_branch.', '.$FTL_commit.')';
} else {
$ftlVersionStr = '<a href="'.$ftlUrl.'/'.$FTL_current.'" rel="noopener" target="_blank">'.$FTL_current.'</a>';
}

if ($docker_current) {
$dockerVersionStr = '<a href="'.$dockerUrl.'/'.$docker_current.'" rel="noopener" target="_blank">'.$docker_current.'</a>';
} else {
$dockerVersionStr = '';
}