From 874e72bf8055a22acb3bdef203ac5f363f6cfaa0 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 8 Nov 2019 20:47:58 +0100 Subject: mirrorlist.php: ipversion should be ORed, not ANDed --- mirrorlist.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'mirrorlist.php') diff --git a/mirrorlist.php b/mirrorlist.php index c9df00d..56bebea 100644 --- a/mirrorlist.php +++ b/mirrorlist.php @@ -69,9 +69,13 @@ if (array_key_exists('country', $_GET)) { $filter .= '"")'; } - foreach ($ip_versions as $ip_version) - if (strpos($request, '&ip_version=' . $ip_version . '&') !== false) - $filter .= ' AND `mirror_statuses`.`ipv' . $ip_version . '`'; + if (array_key_exists('ip_version', $_GET)) { + $filter .= ' AND (0'; + foreach ($ip_versions as $ip_version) + if (strpos($request, '&ip_version=' . $ip_version . '&') !== false) + $filter .= ' OR `mirror_statuses`.`ipv' . $ip_version . '`'; + $filter .= ')'; + } $result = mysql_run_query( 'SELECT DISTINCT ' . -- cgit v1.2.3-70-g09d2