index : website | |
Archlinux32 website - obsolete | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2019-06-07 21:32:35 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-06-07 21:32:35 +0200 |
commit | 296cf837d26a6a138c28902a8813cf73b2545a97 (patch) | |
tree | a9e27154bdb6a511de5bd5a42ee6746cb769610c /pool.php | |
parent | e1752f263031860b7b374f7d715c395f8f87eaaa (diff) |
-rw-r--r-- | pool.php | 7 |
@@ -12,6 +12,12 @@ if (array_key_exists('HTTPS',$_SERVER) && ($_SERVER['HTTPS']=='on')) else $protocol = 'http'; +$ipv_filter = ''; +if (filter_var($_SERVER['SERVER_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) + $ipv_filter .= ' AND `mirror_statuses`.`ipv4`'; +if (filter_var($_SERVER['SERVER_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) + $ipv_filter .= ' AND `mirror_statuses`.`ipv6`'; + $result = mysql_run_query( 'SELECT `mirror_statuses`.`url` FROM `mirror_statuses`' . ' WHERE `mirror_statuses`.`active`' . @@ -19,6 +25,7 @@ $result = mysql_run_query( ' AND `mirror_statuses`.`start` > UNIX_TIMESTAMP(NOW())-' . $cutoff . ' AND `mirror_statuses`.`protocol` = "' . $protocol . '"' . ' AND `mirror_statuses`.`url` NOT LIKE "%.oss/%"' . + $ipv_filter . ' GROUP BY `mirror_statuses`.`url`' . ' ORDER BY SHA2(' . 'CONCAT(' . |