From fdd088f53a69e4b758250abab6dcde011099d61f Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Thu, 27 Jan 2022 16:42:54 +0100 Subject: support for mirror fetching by archinstall --- mirrorlist.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mirrorlist.php b/mirrorlist.php index d15020c..912010e 100644 --- a/mirrorlist.php +++ b/mirrorlist.php @@ -42,7 +42,9 @@ while ($row = $result -> fetch_assoc()) $ip_versions = array('4', '6'); -if (array_key_exists('country', $_GET)) { +# archinstall sends no country, so we can not take this as a hint here whether +# we come via the form or not +if ( count($_GET) > 1 ) { if (array_key_exists('use_mirror_status', $_GET)) $order = '(`mirror_statuses`.`start`-`mirror_statuses`.`last_sync`) DESC'; @@ -64,7 +66,9 @@ if (array_key_exists('country', $_GET)) { $filter .= '"")'; } - if (strpos($request, '&country=all&') === false) { + if (strpos($request, '&country=all&') !== false || strpos($request, "&country=") === false ) { + // country us all or doesn't exist (archinsetall) => do not filter by country + } else { $filter .= ' AND `mirror_statuses`.`country_code` IN ('; foreach ($countries as $country) if (strpos($request, '&country=' . $country['country_code'] . '&') !== false) -- cgit v1.2.3-54-g00ecf