diff --git a/src/www/system_gateways_edit.php b/src/www/system_gateways_edit.php index 38e0c4d2e..985b04997 100644 --- a/src/www/system_gateways_edit.php +++ b/src/www/system_gateways_edit.php @@ -35,6 +35,7 @@ $gateways = new \OPNsense\Routing\Gateways(); $a_gateways = array_values($gateways->gatewaysIndexedByName(true, false, true)); $dpinger_default = $gateways->getDpingerDefaults(); + // form processing if ($_SERVER['REQUEST_METHOD'] === 'POST') { $pconfig = $_POST; @@ -334,6 +335,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } elseif (isset($gateway['fargw'])) { unset($gateway['fargw']); } + /* XXX: temporary solution to prevent default values being stored when unchanged */ + foreach ($dpinger_default as $key => $value) { + if (isset($gateway[$key]) && $gateway[$key] == $value) { + unset($gateway[$key]); + } + } /* when saving the manual gateway we use the attribute which has the corresponding id */ if (isset($realid)) {