summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorGuillaume Mazoyer <gmazoyer@gravitons.in>2014-08-05 09:37:29 +0200
committerGuillaume Mazoyer <gmazoyer@gravitons.in>2014-08-05 09:37:29 +0200
commitd3a7ab0b69b0b7ea3294a986946be5b32ec353fd (patch)
tree9a435431188fa8c08642929e4230698cd296c30d /index.php
parent2de01c4cea4fbb9a5278350788d37df836305874 (diff)
parentb011e311ef55524f5c84d522c52f874251318160 (diff)
Merge pull request #3 from rboissat/master
Adding HTTP_X_FORWARDED_FOR support.
Diffstat (limited to 'index.php')
-rw-r--r--index.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/index.php b/index.php
index 5eef817..7c7f6a8 100644
--- a/index.php
+++ b/index.php
@@ -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'])) {