Skip to content

Commit f30e81b

Browse files
authored
Merge pull request hestiacp#2071 from xtrime-ru/trim_ips
Fix: trim whitespaces in allowed ip list
2 parents a92f143 + 2b63dc6 commit f30e81b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

web/login/index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ function authenticate_user($user, $password, $twofa = ''){
159159

160160
if ($data[$user]['LOGIN_USE_IPLIST'] === 'yes') {
161161
$v_login_user_allowed_ips = explode(',', $data[$user]['LOGIN_ALLOW_IPS']);
162-
if (!in_array($ip, $v_login_user_allowed_ips)) {
162+
$v_login_user_allowed_ips = array_map('trim', $v_login_user_allowed_ips);
163+
if (!in_array($ip, $v_login_user_allowed_ips, true)) {
163164
sleep(2);
164165
$error = '<a class="error">' . _('Invalid username or password') . '</a>';
165166
$v_session_id = escapeshellarg($_POST['token']);

0 commit comments

Comments
 (0)