mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 08:34:39 +00:00
interfaces: make sure descriptions are properly cleansed, save description when disabled too (missed in https://github.com/opnsense/core/pull/3808) closes https://github.com/opnsense/core/issues/3942
This commit is contained in:
parent
86afa90afb
commit
2a80d1a8a2
@ -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');
|
||||
|
||||
@ -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') {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user