diff options
author | Romain Boissat rboissat <rboissat@lv0.in> | 2014-08-05 09:33:35 +0200 |
---|---|---|
committer | Romain Boissat rboissat <rboissat@lv0.in> | 2014-08-05 09:33:35 +0200 |
commit | b011e311ef55524f5c84d522c52f874251318160 (patch) | |
tree | c6543968ea2bff1aaba1b0eedc63fa063ee181b3 | |
parent | c3023fa66fe7846fbd008b26752570b4a3e979a5 (diff) |
adding HTTP_X_FORWARDED_FOR support
-rw-r--r-- | index.php | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -157,7 +157,11 @@ final class LookingGlass { if (!isset($this->frontpage['show_visitor_ip']) || $this->frontpage['show_visitor_ip']) { - print 'Your IP address: '.htmlentities($_SERVER['REMOTE_ADDR']).'<br />'; + if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { + print 'Your IP address: '.htmlentities($_SERVER['HTTP_X_FORWARDED_FOR']).'<br />'; + } else { + print 'Your IP address: '.htmlentities($_SERVER['REMOTE_ADDR']).'<br />'; + } } if (isset($this->frontpage['disclaimer'])) { |