mirror of
https://github.com/Mibew/mibew.git
synced 2025-06-01 15:02:34 +03:00
get correct User IP when has proxy
RT, we should match all pattern and use the last IP string as user IP.
This commit is contained in:
parent
29c9d8dc7d
commit
aa3ae32a94
@ -266,8 +266,8 @@ class UsersProcessor extends ClientSideProcessor implements AuthenticationManage
|
||||
);
|
||||
|
||||
// Get user ip
|
||||
if (preg_match("/(\\d+\\.\\d+\\.\\d+\\.\\d+)/", $thread->remote, $matches) != 0) {
|
||||
$user_ip = $matches[1];
|
||||
if (preg_match_all("/(\\d+\\.\\d+\\.\\d+\\.\\d+)/", $thread->remote, $matches) != 0) {
|
||||
$user_ip = end($matches[1]);
|
||||
} else {
|
||||
$user_ip = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user