mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 18:28:49 +02: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
|
@ -22,8 +22,9 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Entity\LogSystem;
|
||||
|
||||
use App\Helpers\IPAnonymizer;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\HttpFoundation\IpUtils;
|
||||
|
||||
|
||||
/**
|
||||
* This log entry is created when a user logs in.
|
||||
|
@ -59,7 +60,7 @@ class UserLoginLogEntry 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