Commit 73631553 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(legacy) Unable to use commas in advanced DHCP client options...

(legacy) Unable to use commas in advanced DHCP client options https://github.com/opnsense/core/issues/530

(cherry picked from commit dbaf457b)
parent 33ccb038
......@@ -3574,7 +3574,7 @@ function DHCP6_Config_File_Advanced($interface, $wancfg, $wanif)
{
$send_options = "";
if ($wancfg['adv_dhcp6_interface_statement_send_options'] != '') {
$options = split(",", $wancfg['adv_dhcp6_interface_statement_send_options']);
$options = preg_split('/\s*,\s*(?=(?:[^"]*"[^"]*")*[^"]*$)/', $wancfg['adv_dhcp6_interface_statement_send_options']);
foreach ($options as $option) {
$send_options .= "\tsend " . trim($option) . ";\n";
}
......@@ -3582,7 +3582,7 @@ function DHCP6_Config_File_Advanced($interface, $wancfg, $wanif)
$request_options = "";
if ($wancfg['adv_dhcp6_interface_statement_request_options'] != '') {
$options = split(",", $wancfg['adv_dhcp6_interface_statement_request_options']);
$options = preg_split('/\s*,\s*(?=(?:[^"]*"[^"]*")*[^"]*$)/', $wancfg['adv_dhcp6_interface_statement_request_options']);
foreach ($options as $option) {
$request_options .= "\trequest " . trim($option) . ";\n";
}
......@@ -3834,7 +3834,7 @@ function DHCP_Config_File_Advanced($interface, $wancfg, $wanif) {
$send_options = "";
if ($wancfg['adv_dhcp_send_options'] != '') {
$options = split(",", $wancfg['adv_dhcp_send_options']);
$options = preg_split('/\s*,\s*(?=(?:[^"]*"[^"]*")*[^"]*$)/', $wancfg['adv_dhcp_send_options']);
foreach ($options as $option) {
$send_options .= "\tsend " . trim($option) . ";\n";
}
......@@ -3852,7 +3852,7 @@ function DHCP_Config_File_Advanced($interface, $wancfg, $wanif) {
$option_modifiers = "";
if ($wancfg['adv_dhcp_option_modifiers'] != '') {
$modifiers = split(",", $wancfg['adv_dhcp_option_modifiers']);
$modifiers = preg_split('/\s*,\s*(?=(?:[^"]*"[^"]*")*[^"]*$)/', $wancfg['adv_dhcp_option_modifiers']);
foreach ($modifiers as $modifier) {
$option_modifiers .= "\t" . trim($modifier) . ";\n";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment