mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Fixed #8159 added a sort by index after a delete call has been made to make sure it lines up correctly.
This commit is contained in:
parent
cedfb2bc04
commit
581c2d5f4d
@ -188,6 +188,12 @@ if ($_POST['save']) {
|
||||
|
||||
if ($_POST['act'] == "del") {
|
||||
if ($_POST['type'] == 'host') {
|
||||
// it gets sorted by hostname on load
|
||||
// sort it by index so it deletes the correct one.
|
||||
usort($a_hosts, function($a,$b){
|
||||
return($a['idx'] > $b['idx']);
|
||||
});
|
||||
|
||||
if ($a_hosts[$_POST['id']]) {
|
||||
unset($a_hosts[$_POST['id']]);
|
||||
write_config();
|
||||
@ -196,6 +202,12 @@ if ($_POST['act'] == "del") {
|
||||
exit;
|
||||
}
|
||||
} elseif ($_POST['type'] == 'doverride') {
|
||||
// gets sorted by name on load
|
||||
// sort by index to delete the correct one.
|
||||
usort($a_domainOverrides, function($a,$b){
|
||||
return($a['idx'] > $b['idx']);
|
||||
});
|
||||
|
||||
if ($a_domainOverrides[$_POST['id']]) {
|
||||
unset($a_domainOverrides[$_POST['id']]);
|
||||
write_config();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user