Check also forwarded header for IP retrieval
This commit is contained in:
parent
52e8ed7917
commit
aa6132a354
1 changed files with 6 additions and 1 deletions
|
@ -98,7 +98,12 @@ class DataHandler {
|
|||
protected function traficLimiterCanPass() {
|
||||
if (self::TRAFIC_LIMITER === 0) return true;
|
||||
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
if (!isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
} else {
|
||||
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
}
|
||||
|
||||
$filename = self::DATA_FOLDER.self::IP_LIST_FILENAME;
|
||||
|
||||
// create storage for ip_list if not exists
|
||||
|
|
Loading…
Reference in a new issue