mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
web/html/packages.php: Remove duplicate code
Retrieve the package ID early and merge the if-branches calling package_details(). Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
97085daadc
commit
5b0f1f39db
1 changed files with 10 additions and 14 deletions
|
@ -89,28 +89,24 @@ html_header($title);
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if (isset($_GET['ID'])) {
|
if (isset($_GET['ID'])) {
|
||||||
include('pkg_search_form.php');
|
$pkgid = intval($_GET['ID']);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (isset($_GET['N'])) {
|
} else if (isset($_GET['N'])) {
|
||||||
include('pkg_search_form.php');
|
$pkgid = pkgid_from_name($_GET['N']);
|
||||||
if (!$pkgid = pkgid_from_name($_GET['N'])) {
|
|
||||||
print __("Error trying to retrieve package details.")."<br />\n";
|
|
||||||
} else {
|
} else {
|
||||||
|
unset($pkgid);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($pkgid)) {
|
||||||
|
include('pkg_search_form.php');
|
||||||
|
if ($pkgid) {
|
||||||
if (isset($_COOKIE["AURSID"])) {
|
if (isset($_COOKIE["AURSID"])) {
|
||||||
package_details($pkgid, $_COOKIE["AURSID"]);
|
package_details($pkgid, $_COOKIE["AURSID"]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
package_details($pkgid, null);
|
package_details($pkgid, null);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
print __("Error trying to retrieve package details.")."<br />\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!isset($_GET['K']) && !isset($_GET['SB'])) {
|
if (!isset($_GET['K']) && !isset($_GET['SB'])) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue