interfaces: fix expire dhcp6c regex further

According to the manual "forever" is actually the correct keyword.
Also the double-pipe was senseless matching an empty expression
and there was a dash missing between month and day.
This commit is contained in:
Franco Fichtner 2022-07-19 08:14:28 +02:00
parent 9173e30921
commit b66ff4bc5b

View File

@ -3072,7 +3072,7 @@ function DHCP6_Config_File_Advanced($interface, $wancfg, $wanif, $id = 0)
$key_info_statement .= " realm \"{$wancfg['adv_dhcp6_key_info_statement_realm']}\";\n";
$key_info_statement .= " keyid {$wancfg['adv_dhcp6_key_info_statement_keyid']};\n";
$key_info_statement .= " secret \"{$wancfg['adv_dhcp6_key_info_statement_secret']}\";\n";
if (preg_match("/((([0-9]{4}-)?[0-9]{2}[0-9]{2} )?[0-9]{2}:[0-9]{2})||(forever)/", $wancfg['adv_dhcp6_key_info_statement_expire'])) {
if (preg_match("/((([0-9]{4}-)?[0-9]{2}-[0-9]{2} )?[0-9]{2}:[0-9]{2})|(forever)/", $wancfg['adv_dhcp6_key_info_statement_expire'])) {
$key_info_statement .= " expire \"{$wancfg['adv_dhcp6_key_info_statement_expire']}\";\n";
}
$key_info_statement .= "};\n";