Commit 5b0f1f39 authored by Lukas Fleischer's avatar Lukas Fleischer
Browse files

web/html/packages.php: Remove duplicate code



Retrieve the package ID early and merge the if-branches calling
package_details().

Signed-off-by: default avatarLukas Fleischer <archlinux@cryptocrack.de>
parent 97085daa
......@@ -89,28 +89,24 @@ html_header($title);
<?php
if (isset($_GET['ID'])) {
include('pkg_search_form.php');
if (!$_GET['ID'] = intval($_GET['ID'])) {
print __("Error trying to retrieve package details.")."<br />\n";
} else {
if (isset($_COOKIE["AURSID"])) {
package_details($_GET['ID'], $_COOKIE["AURSID"]);
}
else {
package_details($_GET['ID'], null);
}
}
$pkgid = intval($_GET['ID']);
} else if (isset($_GET['N'])) {
$pkgid = pkgid_from_name($_GET['N']);
} else {
unset($pkgid);
}
if (isset($pkgid)) {
include('pkg_search_form.php');
if (!$pkgid = pkgid_from_name($_GET['N'])) {
print __("Error trying to retrieve package details.")."<br />\n";
} else {
if ($pkgid) {
if (isset($_COOKIE["AURSID"])) {
package_details($pkgid, $_COOKIE["AURSID"]);
}
else {
package_details($pkgid, null);
}
} else {
print __("Error trying to retrieve package details.")."<br />\n";
}
} else {
if (!isset($_GET['K']) && !isset($_GET['SB'])) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment