feat: IP ban support (#185) (#188)

This commit is contained in:
Ferywir
2026-06-09 14:15:27 +02:00
committed by GitHub
parent d30bef0a40
commit 20804d9182
12 changed files with 501 additions and 9 deletions
+2 -2
View File
@@ -51,9 +51,9 @@ class AccessLogger {
$prefix[] = date('j.m.Y H:i:s');
}
// add IP
// add IP (proxy-aware, issue #185: real client IP behind a trusted reverse proxy)
if (!defined('PAGE_ACCESS_LOG_IP') || (defined('PAGE_ACCESS_LOG_IP') && PAGE_ACCESS_LOG_IP)) {
$prefix[] = $_SERVER['REMOTE_ADDR'];
$prefix[] = IpResolver::getClientIp() ?? ($_SERVER['REMOTE_ADDR'] ?? '0.0.0.0');
}
// add the actual file name