index : archweb32 | |
Archlinux32 website | gitolite user |
summaryrefslogtreecommitdiff |
-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(' . |