43,6 → 43,7 |
$l_submit = "Enregistrer"; |
$l_add_to_list = "Ajouter à la liste"; |
$l_apply = "Appliquer les changements"; |
$l_invalid_ip = "Format d'adresse IP invalide"; |
} else if($Language == 'es') { |
$l_load="Cargando..."; |
$l_error_open_file = "Error en la lectura del archivo"; |
60,6 → 61,7 |
$l_submit = "Enviar"; |
$l_add_to_list = "Agregar a la lista"; |
$l_apply = "Aplicar cambios"; |
$l_invalid_ip = "Formato de dirección IP inválido"; |
} else { |
$l_load="Loading..."; |
$l_error_open_file = "File open error"; |
77,6 → 79,7 |
$l_submit = "Submit"; |
$l_add_to_list = "Add to list"; |
$l_apply = "Apply changes"; |
$l_invalid_ip = "Invalid IP address format"; |
} |
if (isset($_POST['choix'])){ |
switch ($_POST['choix']) |
145,8 → 148,8 |
break; |
case 'new_ip' : |
$ipAddr = trim($_POST['add_ip']); |
if (!preg_match('/^([0-9]{1,3}\.){3}([0-9]{1,3})$/', $ipAddr)) { |
echo '<span style="color: red;">'.'Invalid IP address'.'</span>'; // TODO : need to translate |
if (!preg_match('/^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$/', $ipAddr)) { |
echo '<span style="color: red;">'. $l_invalid_ip .'</span>'; |
} else if (!empty($ipAddr)) { |
$tab=file(IP_ALLOWED_LIST); |
$insert = true; |