Skip to content

Commit

Permalink
code stle fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
tianyong90 committed Mar 13, 2016
1 parent 3267f98 commit 581afde
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/Payment/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* @link https://github.com/overtrue
* @link http://overtrue.me
*/

namespace EasyWeChat\Payment;

/**
Expand All @@ -43,22 +44,24 @@ function generate_sign(array $attributes, $key, $encryptMethod = 'md5')
*
* @return string
*/
function get_client_ip() {
function get_client_ip()
{
$ipAddress = '';
if (getenv('HTTP_CLIENT_IP')) {
$ipAddress = getenv('HTTP_CLIENT_IP');
} elseif(getenv('HTTP_X_FORWARDED_FOR')) {
} elseif (getenv('HTTP_X_FORWARDED_FOR')) {
$ipAddress = getenv('HTTP_X_FORWARDED_FOR');
} elseif(getenv('HTTP_X_FORWARDED')) {
} elseif (getenv('HTTP_X_FORWARDED')) {
$ipAddress = getenv('HTTP_X_FORWARDED');
} elseif(getenv('HTTP_FORWARDED_FOR')) {
} elseif (getenv('HTTP_FORWARDED_FOR')) {
$ipAddress = getenv('HTTP_FORWARDED_FOR');
} elseif(getenv('HTTP_FORWARDED')) {
$ipAddress = getenv('HTTP_FORWARDED');
} elseif(getenv('REMOTE_ADDR')) {
} elseif (getenv('HTTP_FORWARDED')) {
$ipAddress = getenv('HTTP_FORWARDED');
} elseif (getenv('REMOTE_ADDR')) {
$ipAddress = getenv('REMOTE_ADDR');
} else {
$ipAddress = 'UNKNOWN';
}

return $ipAddress;
}
}

0 comments on commit 581afde

Please sign in to comment.