#455 fixed IP check

This commit is contained in:
Roland Gruber 2025-08-04 09:49:19 +02:00
parent 1f3ef9d824
commit a4ae34fff5

View file

@ -262,7 +262,7 @@ if (isset($_POST['submitFormData'])) {
} }
// check each line // check each line
$ipRegex = '/^[0-9a-f\\.:\\*]+$/i'; $ipRegex = '/^[0-9a-f\\.:\\*]+$/i';
if (!preg_match($ipRegex, $allowedHostsSelfServiceList[$i]) || (strlen($allowedHostsSelfServiceList[$i]) > 15)) { if (!preg_match($ipRegex, $allowedHostsSelfServiceList[$i]) || (strlen($allowedHostsSelfServiceList[$i]) > 45)) {
$errors[] = sprintf(_("The IP address %s is invalid!"), htmlspecialchars(str_replace('%', '%%', $allowedHostsSelfServiceList[$i]))); $errors[] = sprintf(_("The IP address %s is invalid!"), htmlspecialchars(str_replace('%', '%%', $allowedHostsSelfServiceList[$i])));
} }
} }