checkHuman

This commit is contained in:
troy 2022-01-22 11:52:53 +01:00
parent 209bb0b00c
commit ff40210fb6

View File

@ -24,4 +24,16 @@ $_ips_crawler = array (
'34.79.234.76', // google
'148.251.120.201' // mj12bot
);
function checkHuman() {
global $_ips_crawler;
if (stripos ( $_SERVER ['HTTP_USER_AGENT'], 'bot' ) !== false) {
return false;
}
foreach ( $_ips_crawler as $np ) {
if (startsWith ( $_SERVER ['REMOTE_ADDR'], $np )) {
return false;
}
}
return true;
}
?>