Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/php8funcs.php7
-rw-r--r--mirrorlist.php12
2 files changed, 13 insertions, 6 deletions
diff --git a/lib/php8funcs.php b/lib/php8funcs.php
new file mode 100644
index 0000000..358cf98
--- /dev/null
+++ b/lib/php8funcs.php
@@ -0,0 +1,7 @@
+<?php
+
+function str_starts_with($string, $startString)
+{
+ $len = strlen($startString);
+ return (substr($string, 0, $len) === $startString);
+}
diff --git a/mirrorlist.php b/mirrorlist.php
index 7549b01..fb2dbf2 100644
--- a/mirrorlist.php
+++ b/mirrorlist.php
@@ -3,6 +3,7 @@ require_once "init.php";
include BASE . "/lib/mysql.php";
include BASE . "/lib/style.php";
+include BASE . "/lib/php8funcs.php";
# as in mirrors.php (increased again, eliminated some legit mirrors!)
$cutoff = 7*24*60*60;
@@ -109,13 +110,12 @@ if ( count($_GET) > 1 ) {
print "## " . $mirror['country'] . "\n";
$last_country = $mirror['country'];
}
- # I'm sure this can be done differently..
- if( $mirror["url"] == "http://archlinux32.agoctrl.org/" ||
- $mirror["url"] == "https://archlinux32.agoctrl.org/" ||
- $mirror["url"] == "https://mirror.qctronics.com/arch32/" ) {
- continue;
+ if( str_starts_with( $mirror["url"], "http://archlinux32.agoctrl.org/" ) ||
+ str_starts_with( $mirror["url"], "https://archlinux32.agoctrl.org/" ) ||
+ str_starts_with( $mirror["url"], "https://mirror.qctronics.com/arch32/" ) ) {
+ } else {
+ print "#Server = " . $mirror['url'] . '$arch/$repo' . "\n";
}
- print "#Server = " . $mirror['url'] . '$arch/$repo' . "\n";
}
die();