diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2021-07-20 05:29:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-20 05:29:38 +0300 |
commit | 78387db99ce0e0fe6d7226fd8cb40a5458c4353a (patch) | |
tree | 8a90bb0721be72225c07f3891c10c030e64c78e2 /core | |
parent | 9aea15489e3a4bd237933e089daaae64722efec2 (diff) |
do not ignore remote_addr if reading the last ip in proxy header lists (#17790)
Co-authored-by: diosmosis <diosmosis@users.noreply.github.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/IP.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/IP.php b/core/IP.php index 28b640e7d3..ec476043f4 100644 --- a/core/IP.php +++ b/core/IP.php @@ -78,10 +78,12 @@ class IP $proxyIps = array(); } - $proxyIps[] = $default; - $shouldReadLastProxyIp = Config::getInstance()->General['proxy_ip_read_last_in_list'] == 1; + if (!$shouldReadLastProxyIp) { + $proxyIps[] = $default; + } + // examine proxy headers foreach ($proxyHeaders as $proxyHeader) { if (!empty($_SERVER[$proxyHeader])) { |