index : archweb32 | |
Archlinux32 website | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2019-02-07 15:25:36 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-02-07 15:25:36 +0100 |
commit | bffc28e4bf5cfeae4a84746b2794682acf17e187 (patch) | |
tree | 36e3b8f14dd7fff5ef031bd39e28b6ec738d855b /packages | |
parent | 99e6e4b641ad2214c6fe7e7d2484c9d64a1d83b6 (diff) |
-rw-r--r-- | packages/pkginfo.php | 16 |
diff --git a/packages/pkginfo.php b/packages/pkginfo.php index 7cf1e5d..022f699 100644 --- a/packages/pkginfo.php +++ b/packages/pkginfo.php @@ -5,6 +5,17 @@ $uri_prefix = explode('/', $_SERVER['REQUEST_URI']); $uri_prefix = array_slice($uri_prefix, 0, -4); $uri_prefix = implode('/', $uri_prefix) . '/'; +if ((!array_key_exists('arch', $_GET) && + !array_key_exists('repo_arch', $_GET)) || + !array_key_exists('repo', $_GET) || + !array_key_exists('pkgname', $_GET)) + throw_http_error(422, 'Unprocessable Entity'); + +if (!array_key_exists('repo_arch', $_GET)) { + $_GET['repo_arch'] = $_GET['arch']; + unset($_GET['arch']); +} + if (($_GET['repo']=='i686') || ($_GET['repo']=='i486') || ($_GET['repo']=='any')) { header('Location: /' . $_GET['repo'] . '/' . $_GET['repo_arch'] . '/' . $_GET['pkgname'] . '/'); error_log('needed redirect URL: ' . $_SERVER['REQUEST_URI'] . ', HTTP_USER_AGENT: ' . $_SERVER['HTTP_USER_AGENT'] . ', HTTP_REFERER: ' . $_SERVER['HTTP_REFERER']); @@ -40,11 +51,6 @@ require_once BASE . "/lib/style.php"; else $skip_json_checks = true; - if (!array_key_exists("repo_arch",$_GET)) { - $_GET["repo_arch"] = $_GET["arch"]; - unset($_GET["arch"]); - } - if (!$skip_json_checks) { $json_content = json_decode( file_get_contents( |