interfaces: allow literal comma by escape sequence '\,'; closes #8503

This commit is contained in:
Franco Fichtner 2025-03-31 11:10:51 +02:00
parent ce2abde150
commit 0a33697a90

View File

@ -3325,9 +3325,9 @@ function DHCP_Config_File_Advanced($interface, $wancfg, $wanif)
$option_modifiers = "";
if ($wancfg['adv_dhcp_option_modifiers'] != '') {
$modifiers = preg_split('/\s*,\s*(?=(?:[^"]*"[^"]*")*[^"]*$)/', $wancfg['adv_dhcp_option_modifiers']);
$modifiers = preg_split('/\s*(?<!\\\),\s*(?=(?:[^"]*"[^"]*")*[^"]*$)/', $wancfg['adv_dhcp_option_modifiers']);
foreach ($modifiers as $modifier) {
$option_modifiers .= "\t" . $modifier . ";\n";
$option_modifiers .= "\t" . str_replace('\,', ',', $modifier) . ";\n";
}
}