aboutsummaryrefslogtreecommitdiffstats
path: root/mirrorlist
diff options
context:
space:
mode:
authorManuel Hiebel <leuhmanu@mageia.org>2016-05-30 00:52:18 +0200
committerManuel Hiebel <leuhmanu@mageia.org>2016-05-30 00:52:18 +0200
commitebfe5b2aa7fc27df6c9aec3929edff632bf3c7dd (patch)
treecd3230ee546d0bc4d52657780ce4099a17601d46 /mirrorlist
parentc2aa6e258393542bf149427cb581f634b25577ef (diff)
downloadwww-ebfe5b2aa7fc27df6c9aec3929edff632bf3c7dd.tar
www-ebfe5b2aa7fc27df6c9aec3929edff632bf3c7dd.tar.gz
www-ebfe5b2aa7fc27df6c9aec3929edff632bf3c7dd.tar.bz2
www-ebfe5b2aa7fc27df6c9aec3929edff632bf3c7dd.tar.xz
www-ebfe5b2aa7fc27df6c9aec3929edff632bf3c7dd.zip
fix geoip require, and add basic var check
Diffstat (limited to 'mirrorlist')
-rw-r--r--mirrorlist/index.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/mirrorlist/index.php b/mirrorlist/index.php
index 69614a769..dd8e3269b 100644
--- a/mirrorlist/index.php
+++ b/mirrorlist/index.php
@@ -1,7 +1,6 @@
<?php
require realpath(__DIR__ . '/../lib/Downloads.php');
-require realpath(__DIR__ . '/../lib/mga_geoip.php');
function get($s){
return $string_var = (string) filter_input(INPUT_GET, $s, FILTER_SANITIZE_STRING);
@@ -14,9 +13,9 @@ $getvar = get("$key");
$list = implode(", ", $v);
if (in_array($getvar, $v)) {
- $out = array($key => $getvar);
+ //$out = array($key => $getvar);
}else{
- $out = array("Error" => "Error $key: $getvar - not in list - $list");
+ $out = "Error $key: $getvar - not in list - $list";
break;
}
}
@@ -55,11 +54,15 @@ if ($source){
if ($release && $arch && $section && $repo){
- $out = str_replace('MIRROR', $dl['mirror_url'], $link);
- //$out = check($arraycheck);
+ $oute = check($arraycheck);
+ $out= str_replace('MIRROR', $dl['mirror_url'], $link);
//print_r($out);
}else{
$out = "Invalid options";
}
-echo $out;
+if ($oute){
+ echo $oute;}
+else{
+ echo $out;
+}