Dont invoke IP validation if its disabled in config.php

This commit is contained in:
Znote 2021-12-15 23:23:24 +01:00
parent f64d190e54
commit 52956f8dab

View File

@ -80,12 +80,14 @@ if (empty($_POST) === false) {
if ($_POST['selected'] != 1) {
$errors[] = 'You are only allowed to have an account if you accept the rules.';
}
if (validate_ip(getIP()) === false && $config['validate_IP'] === true) {
$errors[] = 'Failed to recognize your IP address. (Not a valid IPv4 address).';
if ($config['validate_IP'] === true) {
if (validate_ip(getIP()) === false) {
$errors[] = 'Failed to recognize your IP address. (Not a valid IPv4 address).';
}
}
if (strlen($_POST['flag']) < 1) {
$errors[] = 'Please choose country.';
}
if (strlen($_POST['flag']) < 1) {
$errors[] = 'Please choose country.';
}
}
}