summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2017-02-28 07:14:21 +0100
committerLukas Fleischer <lfleischer@archlinux.org>2017-02-28 07:14:21 +0100
commitcc84e0b7fd7d491e1ba987786c45ddaf5bcd58d4 (patch)
tree6a570536fd8d60d55ebc37623c70564003797c3c
parenteb6ae0c6852f69a62b4e8226f80e337a67ce636e (diff)
downloadaur-cc84e0b7fd7d491e1ba987786c45ddaf5bcd58d4.tar.gz
aur-cc84e0b7fd7d491e1ba987786c45ddaf5bcd58d4.tar.xz
pkgbase.php: Squelch PHP warning
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
-rw-r--r--web/html/pkgbase.php32
1 files changed, 19 insertions, 13 deletions
diff --git a/web/html/pkgbase.php b/web/html/pkgbase.php
index 23aa6c83..ab409845 100644
--- a/web/html/pkgbase.php
+++ b/web/html/pkgbase.php
@@ -145,17 +145,21 @@ if (check_token()) {
}
}
-$pkgs = pkgbase_get_pkgnames($base_id);
-if (!$output && count($pkgs) == 1) {
- /* Not a split package. Redirect to the package page. */
- if (empty($_SERVER['QUERY_STRING'])) {
- header('Location: ' . get_pkg_uri($pkgs[0]) . $fragment);
- } else {
- header('Location: ' . get_pkg_uri($pkgs[0]) . '?' . $_SERVER['QUERY_STRING'] . $fragment);
+if (isset($base_id)) {
+ $pkgs = pkgbase_get_pkgnames($base_id);
+ if (!$output && count($pkgs) == 1) {
+ /* Not a split package. Redirect to the package page. */
+ if (empty($_SERVER['QUERY_STRING'])) {
+ header('Location: ' . get_pkg_uri($pkgs[0]) . $fragment);
+ } else {
+ 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);
?>
@@ -169,10 +173,12 @@ html_header($title, $details);
<?php
include('pkg_search_form.php');
-if (isset($_COOKIE["AURSID"])) {
- pkgbase_display_details($base_id, $details, $_COOKIE["AURSID"]);
-} else {
- pkgbase_display_details($base_id, $details, null);
+if (isset($base_id)) {
+ if (isset($_COOKIE["AURSID"])) {
+ pkgbase_display_details($base_id, $details, $_COOKIE["AURSID"]);
+ } else {
+ pkgbase_display_details($base_id, $details, null);
+ }
}
html_footer(AURWEB_VERSION);