Merge pull request #8096 from righel/fix-issue-8093

fix: error later on when json enconding a binary repr ipv6
pull/8111/head
Luciano Righetti 2022-01-14 12:18:44 +01:00 committed by GitHub
commit e01cd6e622
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -180,7 +180,7 @@ class AuditLog extends AppModel
if (!isset($auditLog['ip']) && $this->logClientIp) {
$ipHeader = Configure::read('MISP.log_client_ip_header') ?: 'REMOTE_ADDR';
if (isset($_SERVER[$ipHeader])) {
$auditLog['ip'] = inet_pton($_SERVER[$ipHeader]); // convert to binary form
$auditLog['ip'] = utf8_encode(inet_pton($_SERVER[$ipHeader])); // convert to binary form
}
}