From 2a67aad1c898c58487f14f4d9198be29f1413543 Fri, 9 Mar 2012 12:18:31 +0100 From: Dario Giovannetti Date: Fri, 9 Mar 2012 12:18:06 +0100 Subject: [PATCH] Query package details directly by name diff --git a/web/html/packages.php b/web/html/packages.php index dc06c7e..f68916d 100644 --- a/web/html/packages.php +++ b/web/html/packages.php @@ -86,18 +86,19 @@ \n"; - } else { - if (isset($_COOKIE["AURSID"])) { - package_details($_GET['ID'], $_COOKIE["AURSID"]); - } - else { - package_details($_GET['ID'], null); - } - } +if (isset($_GET['ID']) || isset($_GET['NAME'])) { + include('pkg_search_form.php'); + $id = (isset($_GET['ID'])) ? intval($_GET['ID']) : pkgid_from_name(urldecode($_GET['NAME'])); + if (!$id) { + print __("Error trying to retrieve package details.")."
\n"; + } else { + if (isset($_COOKIE["AURSID"])) { + package_details($id, $_COOKIE["AURSID"]); + } + else { + package_details($id, null); + } + } } else { if (!isset($_GET['K']) && !isset($_GET['SB'])) { $_GET['SB'] = 'v';