Revision c34b069e
Added by Daniel Wilhelm about 9 years ago
src/etc/inc/interfaces.inc | ||
---|---|---|
4358 | 4358 |
} |
4359 | 4359 |
|
4360 | 4360 |
function DHCP_Config_Option_Split($option_string) { |
4361 |
$options = []; |
|
4362 |
preg_match_all('/[^",]*(?:"[^"]*"[^",]*)+(?:"[^",]*)?|[^,]+/m', $option_string, $result, PREG_PATTERN_ORDER); |
|
4363 |
for ($i = 0; $i < count($result[0]); $i++) { |
|
4364 |
$options[] = $result[0][$i]; |
|
4365 |
} |
|
4366 |
return $options; |
|
4361 |
preg_match_all('/[^",]*(?:"[^"]*"[^",]*)+(?:"[^",]*)?|[^,]+/m', $option_string, $matches, PREG_PATTERN_ORDER); |
|
4362 |
return $matches ? $matches[0] : []; |
|
4367 | 4363 |
} |
4368 | 4364 |
|
4369 | 4365 |
function DHCP_Config_File_Override($wancfg, $wanif) { |
Also available in: Unified diff
simplify DHCP_Config_Option_Split, no loop needed for returning option array
(cherry picked from commit 264ca54e406eee7c01b01f748aabd4a29e9c4872)