trim ip-addresses for validation as they are invalid with leading/trailing spaces

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2018-11-24 07:53:08 +01:00
parent 9d82f0d269
commit a87f1c5561

View File

@@ -87,7 +87,7 @@ if ($action == 'delete') {
$valid_until = isset($_POST['valid_until']) ? (int)$_POST['valid_until'] : -1;
// validate allowed_from
$ip_list = explode(",", $allowed_from);
$ip_list = array_map('trim', explode(",", $allowed_from));
$_check_list = $ip_list;
foreach ($_check_list as $idx => $ip) {
if (validate_ip2($ip, true, 'invalidip', true, true) == false) {