This commit is contained in:
罗光盛 2017-05-23 14:13:45 +00:00 committed by GitHub
commit d21c7b646d

View File

@ -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;
}
@ -438,8 +438,8 @@ class UsersProcessor extends ClientSideProcessor implements AuthenticationManage
$user_agent = get_user_agent_version($details['user_agent']);
// Get user ip
if (preg_match("/(\\d+\\.\\d+\\.\\d+\\.\\d+)/", $details['remote_host'], $matches) != 0) {
$user_ip = $matches[1];
if (preg_match_all("/(\\d+\\.\\d+\\.\\d+\\.\\d+)/", $details['remote_host'], $matches) != 0) {
$user_ip = end($matches[1]);
} else {
$user_ip = false;
}