Add missing user IP fix

This commit is contained in:
罗光盛 2017-03-12 08:54:17 +08:00 committed by GitHub
parent aa3ae32a94
commit a599fafcfc

View File

@ -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;
}