pkgbase.php: Squelch PHP warning

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Lukas Fleischer 2017-02-28 07:14:21 +01:00
parent eb6ae0c685
commit cc84e0b7fd

View file

@ -145,17 +145,21 @@ if (check_token()) {
} }
} }
$pkgs = pkgbase_get_pkgnames($base_id); if (isset($base_id)) {
if (!$output && count($pkgs) == 1) { $pkgs = pkgbase_get_pkgnames($base_id);
if (!$output && count($pkgs) == 1) {
/* Not a split package. Redirect to the package page. */ /* Not a split package. Redirect to the package page. */
if (empty($_SERVER['QUERY_STRING'])) { if (empty($_SERVER['QUERY_STRING'])) {
header('Location: ' . get_pkg_uri($pkgs[0]) . $fragment); header('Location: ' . get_pkg_uri($pkgs[0]) . $fragment);
} else { } else {
header('Location: ' . get_pkg_uri($pkgs[0]) . '?' . $_SERVER['QUERY_STRING'] . $fragment); header('Location: ' . get_pkg_uri($pkgs[0]) . '?' . $_SERVER['QUERY_STRING'] . $fragment);
} }
} }
$details = pkgbase_get_details($base_id); $details = pkgbase_get_details($base_id);
} else {
$details = array();
}
html_header($title, $details); html_header($title, $details);
?> ?>
@ -169,10 +173,12 @@ html_header($title, $details);
<?php <?php
include('pkg_search_form.php'); include('pkg_search_form.php');
if (isset($_COOKIE["AURSID"])) { if (isset($base_id)) {
if (isset($_COOKIE["AURSID"])) {
pkgbase_display_details($base_id, $details, $_COOKIE["AURSID"]); pkgbase_display_details($base_id, $details, $_COOKIE["AURSID"]);
} else { } else {
pkgbase_display_details($base_id, $details, null); pkgbase_display_details($base_id, $details, null);
}
} }
html_footer(AURWEB_VERSION); html_footer(AURWEB_VERSION);