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:
Stephen Jones 2017-12-04 09:59:29 -06:00
parent cedfb2bc04
commit 581c2d5f4d

View File

@ -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();