Skip to content

Commit

Permalink
Fixed proxy support in Visitor::fromServerVar()
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasbachem committed Oct 6, 2013
1 parent fea7709 commit ae2b702
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/GoogleAnalytics/Visitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public function fromUtma($value) {
public function fromServerVar(array $value) {
if(!empty($value['REMOTE_ADDR'])) {
$ip = null;
foreach(array('X_FORWARDED_FOR', 'REMOTE_ADDR') as $key) {
foreach(array('HTTP_X_FORWARDED_FOR', 'HTTP_X_REAL_IP', 'REMOTE_ADDR') as $key) {
if(!empty($value[$key]) && !$ip) {
// First IP address is the one of the client,
// see http://en.wikipedia.org/wiki/X-Forwarded-For
Expand Down

0 comments on commit ae2b702

Please sign in to comment.