chg: [internal] Normalize CIDR and hostname warninglists

pull/6335/head
Jakub Onderka 2020-09-07 19:28:59 +02:00
parent 4a339773b5
commit d6c83993c1
1 changed files with 2 additions and 1 deletions

View File

@ -398,6 +398,7 @@ class Warninglist extends AppModel
{
$outputValues = [];
foreach ($inputValues as $v) {
$v = strtolower($v);
$parts = explode('/', $v, 2);
if (filter_var($parts[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
$maximumNetmask = 32;
@ -438,7 +439,7 @@ class Warninglist extends AppModel
if ($warninglist['Warninglist']['type'] === 'hostname') {
$output = [];
foreach ($values as $v) {
$v = trim($v, '.');
$v = strtolower(trim($v, '.'));
$output[$v] = true;
}
$values = $output;