From cf2f66751238a5c956c69d3852df74c8e9bbbe52 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 22 Mar 2012 09:38:18 +0100 Subject: Support canonical links to packages This is more user-friendly than supporting package IDs only and can be used as a basis to support direct links to AUR packages in places where links are computer-produced (e.g. Wiki templates). Addresses FS#21600 and FS#28839. Signed-off-by: Lukas Fleischer --- web/template/pkg_comments.php | 2 +- web/template/pkg_details.php | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'web/template') diff --git a/web/template/pkg_comments.php b/web/template/pkg_comments.php index aed9ca8..ac6e1de 100644 --- a/web/template/pkg_comments.php +++ b/web/template/pkg_comments.php @@ -36,7 +36,7 @@ while (list($indx, $carr) = each($comments)) { ?> 10 && !isset($_GET['comments'])) { echo '
'; echo ''. __('Show all %s comments', $count) . ''; diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php index 046f836..230cc2c 100644 --- a/web/template/pkg_details.php +++ b/web/template/pkg_details.php @@ -2,7 +2,13 @@ $atype = account_from_sid($SID); $uid = uid_from_sid($SID); -$pkgid = intval($_REQUEST['ID']); +if (isset($_REQUEST['ID'])) { + $pkgid = intval($_REQUEST['ID']); +} +else { + $pkgid = pkgid_from_name($_REQUEST['N']); +} + if ($uid == $row["MaintainerUID"] or ($atype == "Developer" or $atype == "Trusted User")) { -- cgit v1.2.3-54-g00ecf