mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 09:43:03 +00:00
Return 404 error page if invalid package ID is used
We already display the 404 error page if someone tries to access an invalid package via virtual URLs ("/packages/nonexistent"). Add the same check to "web/html/packages.php" to make sure the same error is shown if a user requests package details of a nonexistent package ID via legacy URLs ("/packages.php?ID=-1"). Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
6db0e7c25c
commit
4fc1b9a0ca
1 changed files with 6 additions and 0 deletions
|
@ -18,6 +18,12 @@ if (!isset($pkgid) || !isset($pkgname)) {
|
||||||
} else {
|
} else {
|
||||||
unset($pkgid, $pkgname);
|
unset($pkgid, $pkgname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($pkgid) && ($pkgid == 0 || $pkgid == NULL || $pkgname == NULL)) {
|
||||||
|
header("HTTP/1.0 404 Not Found");
|
||||||
|
include "./404.php";
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set the title to the current query and get package details if required
|
# Set the title to the current query and get package details if required
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue