Skip to content

Commit

Permalink
Tweaking IP utils. See: #526
Browse files Browse the repository at this point in the history
  • Loading branch information
jaswsinc committed Nov 11, 2016
1 parent 3324f59 commit 1b0787f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions s2member/includes/classes/utils-ip.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function current()
if ($ip !== null) {
return $ip;
}
$sources = [
$sources = array(
'HTTP_CF_CONNECTING_IP',
'HTTP_CLIENT_IP',
'HTTP_X_FORWARDED_FOR',
Expand All @@ -48,10 +48,9 @@ public static function current()
'HTTP_FORWARDED',
'HTTP_VIA',
'REMOTE_ADDR',
];
$prioritize_remote_addr = false; // Off by default; can be filtered however.
);
$sources = apply_filters('ws_plugin__s2member_current_ip_sources', $sources);
$prioritize_remote_addr = apply_filters('ws_plugin__s2member_current_ip_prioritize_remote_addr', $prioritize_remote_addr);
$prioritize_remote_addr = apply_filters('ws_plugin__s2member_current_ip_prioritize_remote_addr', false);

if (!empty($_SERVER['REMOTE_ADDR']) && $prioritize_remote_addr) {
if (($_valid_public_ip = self::valid_public((string) $_SERVER['REMOTE_ADDR']))) {
Expand Down

0 comments on commit 1b0787f

Please sign in to comment.