Conditions | 7 |
Paths | 7 |
Total Lines | 19 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
14 | public function getClientIp() |
||
15 | { |
||
16 | if (getenv('HTTP_CLIENT_IP')) { |
||
17 | $ipAddress = getenv('HTTP_CLIENT_IP'); |
||
18 | } elseif (getenv('HTTP_X_FORWARDED_FOR')) { |
||
19 | $ipAddress = getenv('HTTP_X_FORWARDED_FOR'); |
||
20 | } elseif (getenv('HTTP_X_FORWARDED')) { |
||
21 | $ipAddress = getenv('HTTP_X_FORWARDED'); |
||
22 | } elseif (getenv('HTTP_FORWARDED_FOR')) { |
||
23 | $ipAddress = getenv('HTTP_FORWARDED_FOR'); |
||
24 | } elseif (getenv('HTTP_FORWARDED')) { |
||
25 | $ipAddress = getenv('HTTP_FORWARDED'); |
||
26 | } elseif (getenv('REMOTE_ADDR')) { |
||
27 | $ipAddress = getenv('REMOTE_ADDR'); |
||
28 | } else { |
||
29 | $ipAddress = config('settings.nullIpAddress'); |
||
30 | } |
||
31 | |||
32 | return $ipAddress; |
||
33 | } |
||
35 |