Esempio n. 1
0
        $xff = trim(str_replace('for=', '', $ff), '"');
        if (strpos($xff, ':') !== false) {
            $xffa = explode(':', $xff);
            $xff = $xffa[0];
        }
        $xffd = explode('.', $xff);
        if (!($xffd[0] == 10 || $xffd[0] == 172 && $xffd[1] > 15 && $xffd[1] < 33 || $xffd[0] == 192 && $xffd[0] == 168 || $xffd[0] == 169 && $xffd[0] == 254)) {
            $ipl[] = $xff;
        }
    }
    $ipl = array_unique($ipl);
    $match = false;
    $iplog = array();
    foreach ($ipl as $ip) {
        $ipi = sprintf("%u", ip2long($ip));
        $ipd = $db->field("SELECT `country` FROM `" . DB_GEOIP . "` WHERE `ip` < '{$ipi}' ORDER BY `ip` DESC LIMIT 1");
        $iplog[] = "{$ip} ( {$ipd} )";
        if (in_array($ipd, $cntr)) {
            $match = true;
        }
    }
    $url = $match ? false : $flow['flow_url'];
} else {
    $url = false;
}
// Make the URL based on the flow data
if (!$url) {
    if ($flow['flow_space']) {
        $url = $wmsale->get('site', $flow['flow_space'], 'site_url');
        $fid = $id . '-' . $flow['flow_site'];
    } elseif ($flow['flow_site']) {