mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-13 21:59:34 +00:00
Correctly handle IP addresses containing RFC 4007 scoping
This commit is contained in:
parent
c7bf843312
commit
baf8977578
5 changed files with 100 additions and 6 deletions
|
|
@ -44,9 +44,9 @@ namespace App\Entity\LogSystem;
|
|||
use App\Entity\Base\AbstractDBElement;
|
||||
use App\Entity\UserSystem\User;
|
||||
use App\Events\SecurityEvents;
|
||||
use App\Helpers\IPAnonymizer;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use InvalidArgumentException;
|
||||
use Symfony\Component\HttpFoundation\IpUtils;
|
||||
|
||||
/**
|
||||
* This log entry is created when something security related to a user happens.
|
||||
|
|
@ -134,7 +134,7 @@ class SecurityEventLogEntry extends AbstractLogEntry
|
|||
public function setIPAddress(string $ip, bool $anonymize = true): self
|
||||
{
|
||||
if ($anonymize) {
|
||||
$ip = IpUtils::anonymize($ip);
|
||||
$ip = IPAnonymizer::anonymize($ip);
|
||||
}
|
||||
$this->extra['i'] = $ip;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue