summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Wilhelm <shieldwed@outlook.com>2016-06-26 10:33:27 +0200
committerDaniel Wilhelm <shieldwed@outlook.com>2016-06-26 13:31:34 +0200
commit264ca54e406eee7c01b01f748aabd4a29e9c4872 (patch)
treec058e72d70339e2aa1a9aaa656d86e47b6f6dc96
parent332a64d0c8a6486d40c6295351ca3068a77a216a (diff)
downloadpfsense-264ca54e406eee7c01b01f748aabd4a29e9c4872.zip
pfsense-264ca54e406eee7c01b01f748aabd4a29e9c4872.tar.gz
simplify DHCP_Config_Option_Split, no loop needed for returning option array
-rw-r--r--src/etc/inc/interfaces.inc8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc
index 7816298..c97bd72 100644
--- a/src/etc/inc/interfaces.inc
+++ b/src/etc/inc/interfaces.inc
@@ -4364,12 +4364,8 @@ function DHCP_Config_File_Advanced($interface, $wancfg, $wanif) {
}
function DHCP_Config_Option_Split($option_string) {
- $options = [];
- preg_match_all('/[^",]*(?:"[^"]*"[^",]*)+(?:"[^",]*)?|[^,]+/m', $option_string, $result, PREG_PATTERN_ORDER);
- for ($i = 0; $i < count($result[0]); $i++) {
- $options[] = $result[0][$i];
- }
- return $options;
+ preg_match_all('/[^",]*(?:"[^"]*"[^",]*)+(?:"[^",]*)?|[^,]+/m', $option_string, $matches, PREG_PATTERN_ORDER);
+ return $matches ? $matches[0] : [];
}
function DHCP_Config_File_Override($wancfg, $wanif) {
OpenPOWER on IntegriCloud