diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-14 21:25:01 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-14 21:25:01 -0300 |
commit | 3651c99a195685f3a868e159e72c4daf8cb371d3 (patch) | |
tree | cb004dd7b6ca55215a2c20112fe0c5209d98c18e /engine/lib/system_log.php | |
parent | 97e689213ff4e829f251af526ed4e796a3cc2b71 (diff) | |
parent | c2707bb867ddb285af85d7a0e75db26ef692d68c (diff) | |
download | elgg-3651c99a195685f3a868e159e72c4daf8cb371d3.tar.gz elgg-3651c99a195685f3a868e159e72c4daf8cb371d3.tar.bz2 |
Merge branch 'master' into saravea
Conflicts:
mod/blog/views/default/blog/sidebar/archives.php
Diffstat (limited to 'engine/lib/system_log.php')
-rw-r--r-- | engine/lib/system_log.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/engine/lib/system_log.php b/engine/lib/system_log.php index 5a153afb2..84302632e 100644 --- a/engine/lib/system_log.php +++ b/engine/lib/system_log.php @@ -187,7 +187,16 @@ function system_log($object, $event) { $object_subtype = $object->getSubtype(); $event = sanitise_string($event); $time = time(); - $ip_address = sanitise_string($_SERVER['REMOTE_ADDR']); + + if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { + $ip_address = array_pop(explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])); + } elseif (!empty($_SERVER['HTTP_X_REAL_IP'])) { + $ip_address = array_pop(explode(',', $_SERVER['HTTP_X_REAL_IP'])); + } else { + $ip_address = $_SERVER['REMOTE_ADDR']; + } + $ip_address = sanitise_string($ip_address); + $performed_by = elgg_get_logged_in_user_guid(); if (isset($object->access_id)) { |