diff --git a/src/www/interfaces.php b/src/www/interfaces.php index b4cc01596..35aeb2ed3 100644 --- a/src/www/interfaces.php +++ b/src/www/interfaces.php @@ -576,6 +576,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { } } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { $pconfig = $_POST; + $input_errors = array(); if (!empty($_POST['if']) && !empty($a_interfaces[$_POST['if']])) { $if = $_POST['if']; @@ -622,6 +623,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { if (isset($a_interfaces[$if]['wireless'])) { interface_sync_wireless_clones($a_interfaces[$if], false); } + $a_interfaces[$if]['descr'] = preg_replace('/[^a-z_0-9]/i', '', $pconfig['descr']); write_config("Interface {$pconfig['descr']}({$if}) is now disabled."); mark_subsystem_dirty('interfaces'); diff --git a/src/www/interfaces_assign.php b/src/www/interfaces_assign.php index 33a8912a6..7293171c2 100644 --- a/src/www/interfaces_assign.php +++ b/src/www/interfaces_assign.php @@ -152,7 +152,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $newifname = 'opt' . $i; $descr = !empty($_POST['new_entry_descr']) ? $_POST['new_entry_descr'] : 'OPT' . $i; $config['interfaces'][$newifname] = array(); - $config['interfaces'][$newifname]['descr'] = $descr; + $config['interfaces'][$newifname]['descr'] = preg_replace('/[^a-z_0-9]/i', '', $descr);; $config['interfaces'][$newifname]['if'] = $_POST['if_add']; $interfaces = list_interfaces(); if ($interfaces[$_POST['if_add']]['section'] == 'ppps.ppp') {