diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index d513036f1..9a12ba7a4 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -1215,7 +1215,7 @@ EOD; } } } elseif ($ppp['type'] == "pppoe") { - $provider = isset($ppp['provider']) ? $ppp['provider'] : ""; + $provider = $ppp['provider'] ?? ''; $hostuniq = ''; if (!empty($ppp['hostuniq'])) { $hostuniq = '0x' . strtolower(array_shift(unpack('H*', $ppp['hostuniq']))) . '|'; diff --git a/src/www/interfaces.php b/src/www/interfaces.php index 1e3edf718..e22a96bbb 100644 --- a/src/www/interfaces.php +++ b/src/www/interfaces.php @@ -1103,9 +1103,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { } $new_ppp_config['username'] = $pconfig['pppoe_username']; $new_ppp_config['password'] = base64_encode($pconfig['pppoe_password']); - if (!empty($pconfig['provider'])) { - $new_ppp_config['provider'] = $pconfig['provider']; - } + $new_ppp_config['provider'] = $pconfig['provider']; if (!empty($pconfig['pppoe_hostuniq'])) { $new_ppp_config['hostuniq'] = $pconfig['pppoe_hostuniq']; } diff --git a/src/www/interfaces_ppps_edit.php b/src/www/interfaces_ppps_edit.php index 8d00b6413..3380e8f19 100644 --- a/src/www/interfaces_ppps_edit.php +++ b/src/www/interfaces_ppps_edit.php @@ -106,7 +106,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { // special cases $pconfig['password'] = isset($a_ppps[$id]['password']) ? base64_decode($a_ppps[$id]['password']) : null; $pconfig['initstr'] = isset($a_ppps[$id]['initstr']) ? base64_decode($a_ppps[$id]['initstr']) : null; - $pconfig['null_service'] = (isset($a_ppps[$id]['provider']) && empty($a_ppps[$id]['provider'])); if ($pconfig['ptpid'] == null) { $pconfig['ptpid'] = interfaces_ptpid_next(); @@ -162,9 +161,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { if (!empty($pconfig['provider']) && !is_domain($pconfig['provider'])) { $input_errors[] = gettext("The Service name contains invalid characters."); } - if (!empty($pconfig['provider']) && !empty($pconfig['null_service'])) { - $input_errors[] = gettext("Do not specify both a Service name and a NULL Service name."); - } if (($pconfig['idletimeout'] != "") && !is_numericint($pconfig['idletimeout'])) { $input_errors[] = gettext("The idle timeout value must be an integer."); } @@ -239,11 +235,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { } break; case "pppoe": - if (!empty($pconfig['provider'])) { - $ppp['provider'] = $pconfig['provider']; - } else { - $ppp['provider'] = !empty($pconfig['null_service']); - } + $ppp['provider'] = $pconfig['provider']; if (!empty($pconfig['hostuniq'])) { $ppp['hostuniq'] = $pconfig['hostuniq']; } @@ -573,8 +565,7 @@ include("head.inc"); -    - /> +