} if ($_POST['save']) { unset($input_errors); $pconfig = $_POST; $reqdfields = explode(" ", "name"); $reqdfieldsn = array("Name"); $pf_version = substr(trim(file_get_contents("/etc/version")), 0, 3); if ($pf_version < 2.1) { $input_errors = eval('do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); return $input_errors;'); } else { do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); } if (strtolower($_POST['name']) == "defaultwhitelist") { $input_errors[] = "Whitelist file names may not be named defaultwhitelist."; } if (is_validwhitelistname($_POST['name']) == false) { $input_errors[] = "Whitelist file name may only consist of the characters \"a-z, A-Z, 0-9 and _\". Note: No Spaces or dashes. Press Cancel to reset."; } /* check for name conflicts */ foreach ($a_suppress as $s_list) { if (isset($id) && $a_suppress[$id] && $a_suppress[$id] === $s_list) { continue; } if ($s_list['name'] == $_POST['name']) { $input_errors[] = "A whitelist file name with this name already exists."; break; } } if (!$input_errors) { $s_list = array(); $s_list['name'] = $_POST['name'];
} if ($w_list['name'] == $_POST['name']) { $input_errors[] = "A whitelist file name with this name already exists."; break; } } // build string lists if (!empty($pconfig[addresses])) { $countArray = count($pconfig[addresses]); $i = 0; foreach ($pconfig[addresses] as $address) { $i++; if (is_validwhitelistname($address[address], 'ip') == false) { $input_errors[] = "List of IPs may only consist of the characters [. : 0-9]. Note: No Spaces."; } if (is_validwhitelistname($address[detail], 'detail') == false) { $input_errors[] = "List of IP descriptions may only consist of the characters [a-z, A-Z 0-9 + , : ' -]."; } if (!empty($address[address]) && !empty($address[uuid])) { $final_address_ip .= $address[address]; $final_address_uuid .= $address[uuid]; if (empty($address[detail])) { $final_address_details .= "Entry added " . date('r'); } else { $final_address_details .= $address[detail]; } if ($i < $countArray) { $final_address_ip .= ','; $final_address_details .= '||'; $final_address_uuid .= '||'; }