Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2022-01-27 16:42:54 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2022-01-27 16:42:54 +0100
commitfdd088f53a69e4b758250abab6dcde011099d61f (patch)
tree750ba91f67388f0f61f949f6ef6da7d0deeaa437
parent8eec1efd97d96910497739bb31cad31081e6965d (diff)
support for mirror fetching by archinstall
-rw-r--r--mirrorlist.php8
1 files 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)