From 6ed9da2c3e56ccf776308f680791099c464b9ab2 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sat, 5 Apr 2014 16:30:45 +0200 Subject: Do not show package base page of non-split packages When trying to access the package base page of non-split packages, redirect to the package details page since the package base page doesn't contain any additional information in that case. Signed-off-by: Lukas Fleischer --- web/html/pkgbase.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'web/html') diff --git a/web/html/pkgbase.php b/web/html/pkgbase.php index 24bbbdc..3369049 100644 --- a/web/html/pkgbase.php +++ b/web/html/pkgbase.php @@ -115,6 +115,12 @@ if (check_token()) { } } +$pkgs = pkgbase_get_pkgnames($base_id); +if (count($pkgs) == 1) { + /* Not a split package. Redirect to the package page. */ + header('Location: ' . get_pkg_uri($pkgs[0])); +} + $details = pkgbase_get_details($base_id); html_header($title, $details); ?> -- cgit v1.2.3-70-g09d2