diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2012-03-22 09:38:18 +0100 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2012-03-24 10:34:35 +0100 |
commit | cf2f66751238a5c956c69d3852df74c8e9bbbe52 (patch) | |
tree | b50d764d9cfd11c1d4e0ef1b14e92807320cc57f /web/html/packages.php | |
parent | 132856a9383776d7e7788620df656db9fbd9883a (diff) | |
download | aurweb-cf2f66751238a5c956c69d3852df74c8e9bbbe52.tar.xz |
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 <archlinux@cryptocrack.de>
Diffstat (limited to 'web/html/packages.php')
-rw-r--r-- | web/html/packages.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/web/html/packages.php b/web/html/packages.php index dc06c7e..8f3b143 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -10,6 +10,8 @@ check_sid(); # see if they're still logged in # Set the title to the current query if required if (isset($_GET['ID']) && ($pkgname = pkgname_from_id($_GET['ID']))) { $title = $pkgname; +} else if (isset($_GET['N'])) { + $title = $pkgname = $_GET['N']; } else if (!empty($_GET['K'])) { $title = __("Search Criteria") . ": " . $_GET['K']; } else { @@ -98,6 +100,18 @@ if (isset($_GET['ID'])) { package_details($_GET['ID'], null); } } +} else if (isset($_GET['N'])) { + include('pkg_search_form.php'); + if (!$pkgid = pkgid_from_name($_GET['N'])) { + print __("Error trying to retrieve package details.")."<br />\n"; + } else { + if (isset($_COOKIE["AURSID"])) { + package_details($pkgid, $_COOKIE["AURSID"]); + } + else { + package_details($pkgid, null); + } + } } else { if (!isset($_GET['K']) && !isset($_GET['SB'])) { $_GET['SB'] = 'v'; |