diff --git a/usr/local/www/vpn_ipsec_phase2.php b/usr/local/www/vpn_ipsec_phase2.php index a97f7d56e8..2bfd905cfb 100644 --- a/usr/local/www/vpn_ipsec_phase2.php +++ b/usr/local/www/vpn_ipsec_phase2.php @@ -207,11 +207,14 @@ if ($_POST) { } } } - - $ealgos = pconfig_to_ealgos($pconfig); - if (!count($ealgos)) { - $input_errors[] = gettext("At least one encryption algorithm must be selected."); + /* For ESP protocol, handle encryption algorithms */ + if ( $pconfig['proto'] == "esp") { + $ealgos = pconfig_to_ealgos($pconfig); + + if (!count($ealgos)) { + $input_errors[] = gettext("At least one encryption algorithm must be selected."); + } } if (($_POST['lifetime'] && !is_numeric($_POST['lifetime']))) { $input_errors[] = gettext("The P2 lifetime must be an integer."); @@ -558,7 +561,7 @@ function change_protocol() { $algodata): $checked = ''; - if (in_array($algo,$pconfig['ealgos'])) + if (is_array($pconfig['ealgos']) && in_array($algo,$pconfig['ealgos'])) $checked = " checked"; ?>