summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Wilhelm <shieldwed@outlook.com>2016-06-26 10:33:27 +0200
committerRenato Botelho <renato@netgate.com>2016-07-13 16:56:58 -0300
commitc34b069e954cafca9caa6cbb4c367c17080a0d0a (patch)
tree7c1b5f598f724e5d333c7cc8fea418f24b68a650
parent489091dcf7c8bebbe9f6f722057c985a8d938295 (diff)
downloadpfsense-c34b069e954cafca9caa6cbb4c367c17080a0d0a.zip
pfsense-c34b069e954cafca9caa6cbb4c367c17080a0d0a.tar.gz
simplify DHCP_Config_Option_Split, no loop needed for returning option array
(cherry picked from commit 264ca54e406eee7c01b01f748aabd4a29e9c4872)
-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 1bbb438..13a66da 100644
--- a/src/etc/inc/interfaces.inc
+++ b/src/etc/inc/interfaces.inc
@@ -4358,12 +4358,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