diff options
author | hamnur <hamnur@protonmail.com> | 2017-07-14 12:29:41 +0200 |
---|---|---|
committer | hamnur <hamnur@protonmail.com> | 2017-07-14 12:29:41 +0200 |
commit | af729f53f3c838f91dffb6368b656ddece527e05 (patch) | |
tree | 1680f13d0c17edc5943831e400b0d0d58c291dd2 /src/usr/local/www | |
parent | e18ddb38449b6463fabf5782284b206a355dbad7 (diff) | |
download | pfsense-af729f53f3c838f91dffb6368b656ddece527e05.zip pfsense-af729f53f3c838f91dffb6368b656ddece527e05.tar.gz |
Check if margintime is numeric and smaller than P1 lifetime
Diffstat (limited to 'src/usr/local/www')
-rw-r--r-- | src/usr/local/www/vpn_ipsec_phase1.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/usr/local/www/vpn_ipsec_phase1.php b/src/usr/local/www/vpn_ipsec_phase1.php index 300ebce..72e9a5c 100644 --- a/src/usr/local/www/vpn_ipsec_phase1.php +++ b/src/usr/local/www/vpn_ipsec_phase1.php @@ -240,8 +240,12 @@ if ($_POST['save']) { $input_errors[] = gettext("The P1 lifetime must be an integer."); } - if (($pconfig['margintime'] && !is_numericint($pconfig['margintime']))) { - $input_errors[] = gettext("The margintime must be an integer."); + if ($pconfig['rekey_enable']) { + if(!is_numericint($pconfig['margintime'])){ + $input_errors[] = gettext("The margintime must be an integer."); + } else if(intval($pconfig['margintime']) >= intval($pconfig['lifetime'])){ + $input_errors[] = gettext("The margintime must be smaller than the P1 lifetime."); + } } if ($pconfig['remotegw']) { |