fix: [flood protection] default to 127.0.0.1 if no remote_addr is set as we're dealing with a local CLI script
parent
c005cb7f66
commit
e2bb58d3c7
|
@ -20,6 +20,11 @@ class FloodProtectionComponent extends Component
|
|||
if (!isset($_SERVER[$ip_source])) {
|
||||
$ip_source = 'REMOTE_ADDR';
|
||||
}
|
||||
if (isset($_SERVER[$ip_source])) {
|
||||
$this->remote_ip = $_SERVER[$ip_source];
|
||||
} else {
|
||||
$this->remote_ip = '127.0.0.1';
|
||||
}
|
||||
$this->remote_ip = $_SERVER[$ip_source];
|
||||
$temp = explode(PHP_EOL, $_SERVER[$ip_source]);
|
||||
if (count($temp) > 1) {
|
||||
|
|
Loading…
Reference in New Issue