aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Downloads.php19
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/Downloads.php b/lib/Downloads.php
index a27757ec6..2a4e1f661 100644
--- a/lib/Downloads.php
+++ b/lib/Downloads.php
@@ -297,6 +297,8 @@ class Downloads
'continent_minus_country' => array(),
'other_continents' => array()
);
+ $hostnames = array();
+ $list_of_mirrs['country_alternate_protocol'] = array();
foreach ($mirs as $curr_continent => $continent_mirrors) {
if ($continent != $curr_continent)
{
@@ -328,13 +330,21 @@ class Downloads
}
if ($mirrorlist)
{
- if ($mirror['country'] == $country)
- {
- $list_of_mirrs['country'][] = $mirror['url'];
+ $pu = parse_url($mirror['url']);
+ if (in_array($pu['host'], $hostnames)) {
+ $list_of_mirrs['country_alternate_protocol'][] = $mirror['url'];
}
else
{
- $list_of_mirrs['continent_minus_country'][] = $mirror['url'];
+ $hostnames[] = $pu['host'];
+ if ($mirror['country'] == $country)
+ {
+ $list_of_mirrs['country'][] = $mirror['url'];
+ }
+ else
+ {
+ $list_of_mirrs['continent_minus_country'][] = $mirror['url'];
+ }
}
}
else
@@ -371,6 +381,7 @@ class Downloads
$resulting_mirrs = array_merge(
$list_of_mirrs['country'],
$list_of_mirrs['continent_minus_country'],
+ $list_of_mirrs['country_alternate_protocol'],
$list_of_mirrs['other_continents']
);
$one_mirror['mirrors_list'] = array_slice($resulting_mirrs, 0, 10);