Check also forwarded header for IP retrieval

This commit is contained in:
Michael Schmidt 2013-10-23 17:54:53 +02:00
parent 52e8ed7917
commit aa6132a354

View file

@ -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