checkHuman
This commit is contained in:
parent
209bb0b00c
commit
ff40210fb6
@ -24,4 +24,16 @@ $_ips_crawler = array (
|
|||||||
'34.79.234.76', // google
|
'34.79.234.76', // google
|
||||||
'148.251.120.201' // mj12bot
|
'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;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
Loading…
Reference in New Issue
Block a user