Skip to content

Commit 2ce660a

Browse files
committed
Unbreak a number of explode() replacements which required preg_split()
1 parent 212ab80 commit 2ce660a

9 files changed

+14
-14
lines changed

etc/inc/auth.inc

+2-2
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ function ldap_get_groups($username, $authcfg) {
852852
return false;
853853

854854
if(stristr($username, "@")) {
855-
$username_split = explode("\@", $username);
855+
$username_split = explode("@", $username);
856856
$username = $username_split[0];
857857
}
858858

@@ -969,7 +969,7 @@ function ldap_backed($username, $passwd, $authcfg) {
969969
return;
970970

971971
if(stristr($username, "@")) {
972-
$username_split = explode("\@", $username);
972+
$username_split = explode("@", $username);
973973
$username = $username_split[0];
974974
}
975975
if(stristr($username, "\\")) {

etc/inc/filter.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ function filter_configure_sync($delete_states_if_needed = true) {
331331
*/
332332
if($rules_loading <> 0) {
333333
$rules_error = exec_command("/sbin/pfctl -f {$g['tmp_path']}/rules.debug");
334-
$line_error = explode("\:", $rules_error);
334+
$line_error = explode(":", $rules_error);
335335
$line_number = $line_error[1];
336336
$line_split = file("{$g['tmp_path']}/rules.debug");
337337
if(is_array($line_split))

etc/inc/filter_log.inc

+4-4
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function parse_filter_line($line) {
150150
/* If we're dealing with TCP, try to determine the flags/control bits */
151151
$flent['tcpflags'] = "";
152152
if ($flent['proto'] == "TCP") {
153-
$flags = explode('[\, ]', $leftovers);
153+
$flags = preg_split('/[, ]/', $leftovers);
154154
$flent['tcpflags'] = str_replace(".", "A", substr($flags[1], 1, -1));
155155
} elseif ($flent['proto'] == "Options") {
156156
$flent['proto'] = "none";
@@ -174,21 +174,21 @@ function parse_ipport($addr) {
174174
$port = '';
175175
if (substr_count($addr, '.') > 1) {
176176
/* IPv4 */
177-
$addr_split = explode("\.", $addr);
177+
$addr_split = explode(".", $addr);
178178
$ip = "{$addr_split[0]}.{$addr_split[1]}.{$addr_split[2]}.{$addr_split[3]}";
179179

180180
if ($ip == "...")
181181
return array($addr, '');
182182

183183
if($addr_split[4] != "") {
184-
$port_split = explode("\:", $addr_split[4]);
184+
$port_split = explode(":", $addr_split[4]);
185185
$port = $port_split[0];
186186
}
187187
} else {
188188
/* IPv6 */
189189
$addr = explode(" ", $addr);
190190
$addr = rtrim($addr[0], ":");
191-
$addr_split = explode("\.", $addr);
191+
$addr_split = explode(".", $addr);
192192
if (count($addr_split) > 1) {
193193
$ip = $addr_split[0];
194194
$port = $addr_split[1];

etc/inc/pfsense-utils.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ function get_carp_status() {
329329
330330
*/
331331
function convert_ip_to_network_format($ip, $subnet) {
332-
$ipsplit = explode('[.]', $ip);
332+
$ipsplit = explode('.', $ip);
333333
$string = $ipsplit[0] . "." . $ipsplit[1] . "." . $ipsplit[2] . ".0/" . $subnet;
334334
return $string;
335335
}

etc/inc/upgrade_config.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1876,7 +1876,7 @@ function upgrade_053_to_054() {
18761876
$gateway_group['item'] = array();
18771877
$i = 0;
18781878
foreach($lbpool['servers'] as $member) {
1879-
$split = explode("\|", $member);
1879+
$split = explode("|", $member);
18801880
$interface = $split[0];
18811881
$monitor = $split[1];
18821882
/* on static upgraded configuration we automatically prepend GW_ */

tmp/post_upgrade_command.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
$newslicedir = '/tmp' . $ARGV[1];
2424
setup_serial_port("upgrade", $newslicedir);
2525

26-
$files_to_process = explode("\n", file_get_contents("/etc/pfSense.obsoletedfiles"));
26+
$files_to_process = file("/etc/pfSense.obsoletedfiles");
2727
foreach($files_to_process as $filename)
2828
if(file_exists($filename))
2929
exec("/bin/rm -f $filename");

usr/local/www/firewall_virtual_ip_edit.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
$id = $_GET['id'];
6565

6666
function return_first_two_octets($ip) {
67-
$ip_split = explode("\.", $ip);
67+
$ip_split = explode(".", $ip);
6868
return $ip_split[0] . "." . $ip_split[1];
6969
}
7070

usr/local/www/widgets/widgets/picture.widget.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
require_once("functions.inc");
3434

3535
if($_GET['getpic']=="true") {
36-
$pic_type_s = explode("\.", $config['widgets']['picturewidget_filename']);
36+
$pic_type_s = explode(".", $config['widgets']['picturewidget_filename']);
3737
$pic_type = $pic_type_s[1];
3838
if($config['widgets']['picturewidget'])
3939
$data = base64_decode($config['widgets']['picturewidget']);

usr/local/www/wizards/setup_wizard.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -502,11 +502,11 @@
502502
print_info_box_np("Invalid LAN IP Address. Please press back in your browser window and correct.");
503503
die;
504504
}
505-
$ft = explode("\.", $_POST['lanipaddress']);
505+
$ft = explode(".", $_POST['lanipaddress']);
506506
$ft_ip = $ft[0] . "." . $ft[1] . "." . $ft[2] . ".";
507507
$config['dhcpd']['lan']['range']['from'] = $ft_ip . "10";
508508
$highestip = gen_subnet_max($_POST['lanipaddress'], $config['interfaces']['lan']['subnet']);
509-
$hi = explode("\.", $highestip);
509+
$hi = explode(".", $highestip);
510510
$highestip = $hi[3]-10;
511511
$config['dhcpd']['lan']['range']['to'] = $ft_ip . $highestip;
512512
]]>

0 commit comments

Comments
 (0)