1
0
forked from HPR/hpr_hub

A series of changes to automate the checking of comments - resulting in a returned json file and standard responses for different actions

This commit is contained in:
2023-12-23 19:06:00 +01:00
parent 92902ffe47
commit 6b84bd01e6
4 changed files with 208 additions and 71 deletions

View File

@@ -287,8 +287,6 @@ function getUserIP()
}
return $ip . "\t" . $_SERVER['REQUEST_URI'] . "\t" . $_SERVER["HTTP_USER_AGENT"] . "\n";
}
$naughtyfile = '/home/hpr/logs/naughty-ip.txt';
# Read more: http://vidiame.com/php/how-to-block-multiple-ip-addresses-using-php
if ( strlen($_SERVER['QUERY_STRING']) > 15 ) {
file_put_contents($naughtyfile, getUserIP(), FILE_APPEND | LOCK_EX );