Ensured visits with empty remote address are not tried to be located

This commit is contained in:
Alejandro Celaya
2018-10-18 19:19:42 +02:00
parent 36ab475578
commit 5be7f839f3
3 changed files with 30 additions and 11 deletions

View File

@@ -59,6 +59,14 @@ class ProcessVisitsCommand extends Command
$count = 0;
foreach ($visits as $visit) {
if (! $visit->hasRemoteAddr()) {
$io->writeln(
sprintf('<comment>%s</comment>', $this->translator->translate('Ignored visit with no IP address')),
OutputInterface::VERBOSITY_VERBOSE
);
continue;
}
$ipAddr = $visit->getRemoteAddr();
$io->write(sprintf('%s <info>%s</info>', $this->translator->translate('Processing IP'), $ipAddr));
if ($ipAddr === IpAddress::LOCALHOST) {