diff options
author | smos <seth.mos@dds.nl> | 2012-01-19 20:33:41 +0100 |
---|---|---|
committer | smos <seth.mos@dds.nl> | 2012-01-19 20:33:41 +0100 |
commit | cfbfd9412b70bda8c34127b8b7dfdceff4872390 (patch) | |
tree | 465ee07c80898171a4cc41a6ac82d9133012797d /etc | |
parent | 80c88a686d0e56b2f2ad774da05debb1a2afba47 (diff) | |
download | pfsense-cfbfd9412b70bda8c34127b8b7dfdceff4872390.zip pfsense-cfbfd9412b70bda8c34127b8b7dfdceff4872390.tar.gz |
The function split() is replaced by the function explode(). Starting with PHP 5.3 this is deprecated and with version 6 gone.
Replacing it surpresses all the warnings
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/ecl.php | 4 | ||||
-rw-r--r-- | etc/inc/auth.inc | 16 | ||||
-rw-r--r-- | etc/inc/captiveportal.inc | 4 | ||||
-rw-r--r-- | etc/inc/config.lib.inc | 2 | ||||
-rw-r--r-- | etc/inc/dyndns.class | 4 | ||||
-rw-r--r-- | etc/inc/filter.inc | 16 | ||||
-rw-r--r-- | etc/inc/filter_log.inc | 14 | ||||
-rw-r--r-- | etc/inc/pfsense-utils.inc | 13 | ||||
-rw-r--r-- | etc/inc/pkg-utils.inc | 2 | ||||
-rw-r--r-- | etc/inc/upgrade_config.inc | 2 | ||||
-rw-r--r-- | etc/inc/voucher.inc | 4 | ||||
-rw-r--r-- | etc/inc/vslb.inc | 2 |
12 files changed, 42 insertions, 41 deletions
diff --git a/etc/ecl.php b/etc/ecl.php index 47e187a..425aed1 100755 --- a/etc/ecl.php +++ b/etc/ecl.php @@ -49,7 +49,7 @@ function get_disk_slices($disk) { $slices = str_replace("/dev/", "", $slices); if($slices == "ls: No match.") return; - $slices_array = split(" ", $slices); + $slices_array = explode(" ", $slices); return $slices_array; } @@ -161,4 +161,4 @@ echo "External config loader 1.0 is now starting..."; find_config_xml(); echo "\n"; -?>
\ No newline at end of file +?> diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index 81d3058..48052a9 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -825,7 +825,7 @@ function ldap_get_user_ous($show_complete_ou=true, $authcfg) { if (is_array($info)) { foreach ($info as $inf) { if (!$show_complete_ou) { - $inf_split = split(",", $inf['dn']); + $inf_split = explode(",", $inf['dn']); $ou = $inf_split[0]; $ou = str_replace("OU=","", $ou); $ou = str_replace("CN=","", $ou); @@ -852,12 +852,12 @@ function ldap_get_groups($username, $authcfg) { return false; if(stristr($username, "@")) { - $username_split=split("\@", $username); + $username_split = explode("\@", $username); $username = $username_split[0]; } if(stristr($username, "\\")) { - $username_split=split("\\", $username); + $username_split = explode("\\", $username); $username = $username_split[0]; } @@ -943,7 +943,7 @@ function ldap_get_groups($username, $authcfg) { /* Iterate through the groups and throw them into an array */ foreach ($info[0][$ldapgroupattribute] as $member) { if (stristr($member, "CN=") !== false) { - $membersplit = split(",", $member); + $membersplit = explode(",", $member); $memberof[] = preg_replace("/CN=/i", "", $membersplit[0]); } } @@ -969,11 +969,11 @@ function ldap_backed($username, $passwd, $authcfg) { return; if(stristr($username, "@")) { - $username_split=split("\@", $username); + $username_split = explode("\@", $username); $username = $username_split[0]; } if(stristr($username, "\\")) { - $username_split=split("\\", $username); + $username_split = explode("\\", $username); $username = $username_split[0]; } @@ -1056,7 +1056,7 @@ function ldap_backed($username, $passwd, $authcfg) { } /* Get LDAP Authcontainers and split em up. */ - $ldac_splits = split(";", $ldapauthcont); + $ldac_splits = explode(";", $ldapauthcont); /* setup the usercount so we think we havn't found anyone yet */ $usercount = 0; @@ -1357,7 +1357,7 @@ function session_auth() { /* and destroy it */ session_destroy(); - $scriptName = split("/", $_SERVER["SCRIPT_FILENAME"]); + $scriptName = explode("/", $_SERVER["SCRIPT_FILENAME"]); $scriptElms = count($scriptName); $scriptName = $scriptName[$scriptElms-1]; diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index e1d80e0..0fda324 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -1505,14 +1505,14 @@ function getVolume($ip) { captiveportal_ipfw_set_context($cpzone); exec("/sbin/ipfw table 1 entrystats {$ip}", $ipfwin); if ($ipfwin[0]) { - $ipfwin = split(" ", $ipfwin[0]); + $ipfwin = explode(" ", $ipfwin[0]); $volume['input_pkts'] = $ipfwin[2]; $volume['input_bytes'] = $ipfwin[3]; } exec("/sbin/ipfw table 2 entrystats {$ip}", $ipfwout); if ($ipfwout[0]) { - $ipfwout = split(" ", $ipfwout[0]); + $ipfwout = explode(" ", $ipfwout[0]); $volume['output_pkts'] = $ipfwout[2]; $volume['output_bytes'] = $ipfwout[3]; } diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc index c54c854..4af04ae 100644 --- a/etc/inc/config.lib.inc +++ b/etc/inc/config.lib.inc @@ -190,7 +190,7 @@ function generate_config_cache($config) { } function discover_last_backup() { - $backups = split("\n", `cd /cf/conf/backup && ls -ltr *.xml | awk '{print \$9}'`); + $backups = explode("\n", `cd /cf/conf/backup && ls -ltr *.xml | awk '{print \$9}'`); $last_backup = ""; foreach($backups as $backup) if($backup) diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class index d980f4b..0f4715d 100644 --- a/etc/inc/dyndns.class +++ b/etc/inc/dyndns.class @@ -525,7 +525,7 @@ case 'dhs': break; case 'noip': - list($ip,$code) = split(":",$data); + list($ip,$code) = explode(":",$data); switch ($code) { case 0: $status = "phpDynDNS: (Success) IP address is current, no update performed."; @@ -900,7 +900,7 @@ if (file_exists($this->_cacheFile)) { $contents = file_get_contents($this->_cacheFile); - list($cacheIP,$cacheTime) = split(':', $contents); + list($cacheIP,$cacheTime) = explode(':', $contents); $this->_debug($cacheIP.'/'.$cacheTime); $initial = false; $log_error .= "Cached IP: {$cacheIP} "; diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index dc635cd..23383c0 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -331,7 +331,7 @@ function filter_configure_sync($delete_states_if_needed = true) { */ if($rules_loading <> 0) { $rules_error = exec_command("/sbin/pfctl -f {$g['tmp_path']}/rules.debug"); - $line_error = split("\:", $rules_error); + $line_error = explode("\:", $rules_error); $line_number = $line_error[1]; $line_split = file("{$g['tmp_path']}/rules.debug"); if(is_array($line_split)) @@ -464,7 +464,7 @@ function filter_generate_scrubing() { function filter_generate_nested_alias($name, $alias, &$aliasnesting, &$aliasaddrnesting) { global $aliastable, $filterdns; - $addresses = split(" ", $alias); + $addresses = explode(" ", $alias); $finallist = ""; $builtlist = ""; $urltable_nesting = ""; @@ -595,9 +595,9 @@ function filter_generate_aliases() { foreach ($config['openvpn']['user'] as $openvpn) $openvpncfg[$openvpn['name']] = $openvpn['ip']; } - $vpn_lines = split("\n", $addrlist); + $vpn_lines = explode("\n", $addrlist); foreach ($vpn_lines as $vpn_line) { - $vpn_address_split = split(" ", $vpn_line); + $vpn_address_split = explode(" ", $vpn_line); foreach($vpn_address_split as $vpnsplit) { if(isset($openvpncfg[$vpnsplit])) { $newaddress .= " "; @@ -2856,7 +2856,7 @@ function filter_tdr_day($schedule) { if($weekday == 0) $weekday = 7; $date = date("d"); - $defined_days = split(",", $schedule); + $defined_days = explode(",", $schedule); if($g['debug']) log_error("[TDR DEBUG] filter_tdr_day($schedule)"); foreach($defined_days as $dd) { @@ -2868,7 +2868,7 @@ function filter_tdr_day($schedule) { function filter_tdr_hour($schedule) { global $g; /* $schedule should be a string such as 16:00-19:00 */ - $tmp = split("-", $schedule); + $tmp = explode("-", $schedule); $starting_time = strtotime($tmp[0]); $ending_time = strtotime($tmp[1]); $now = strtotime("now"); @@ -2893,7 +2893,7 @@ function filter_tdr_position($schedule) { log_error("[TDR DEBUG] filter_tdr_position($schedule) $weekday"); if($weekday == 0) $weekday = 7; - $schedule_days = split(",", $schedule); + $schedule_days = explode(",", $schedule); foreach($schedule_days as $day) { if($day == $weekday) return true; @@ -2907,7 +2907,7 @@ function filter_tdr_month($schedule) { * Calculate month */ $todays_month = date("n"); - $months = split(",", $schedule); + $months = explode(",", $schedule); if($g['debug']) log_error("[TDR DEBUG] filter_tdr_month($schedule)"); foreach($months as $month) { diff --git a/etc/inc/filter_log.inc b/etc/inc/filter_log.inc index 13b68cf..3429ca7 100644 --- a/etc/inc/filter_log.inc +++ b/etc/inc/filter_log.inc @@ -126,7 +126,7 @@ function parse_filter_line($line) { $flent['interface'] = convert_real_interface_to_friendly_descr($flent['realint']); - $tmp = split("/", $rule); + $tmp = explode("/", $rule); $flent['rulenum'] = $tmp[0]; $proto = array(" ", "(?)"); @@ -144,13 +144,13 @@ function parse_filter_line($line) { } elseif (!(strpos($line, 'sum ok] ') === FALSE)) { preg_match("/.*\ssum ok]\s(.*)\,\s.*/", $line, $proto); } - $proto = split(" ", trim($proto[1])); + $proto = explode(" ", trim($proto[1])); $flent['proto'] = rtrim($proto[0], ","); /* If we're dealing with TCP, try to determine the flags/control bits */ $flent['tcpflags'] = ""; if ($flent['proto'] == "TCP") { - $flags = split('[\, ]', $leftovers); + $flags = explode('[\, ]', $leftovers); $flent['tcpflags'] = str_replace(".", "A", substr($flags[1], 1, -1)); } elseif ($flent['proto'] == "Options") { $flent['proto'] = "none"; @@ -174,21 +174,21 @@ function parse_ipport($addr) { $port = ''; if (substr_count($addr, '.') > 1) { /* IPv4 */ - $addr_split = split("\.", $addr); + $addr_split = explode("\.", $addr); $ip = "{$addr_split[0]}.{$addr_split[1]}.{$addr_split[2]}.{$addr_split[3]}"; if ($ip == "...") return array($addr, ''); if($addr_split[4] != "") { - $port_split = split("\:", $addr_split[4]); + $port_split = explode("\:", $addr_split[4]); $port = $port_split[0]; } } else { /* IPv6 */ - $addr = split(" ", $addr); + $addr = explode(" ", $addr); $addr = rtrim($addr[0], ":"); - $addr_split = split("\.", $addr); + $addr_split = explode("\.", $addr); if (count($addr_split) > 1) { $ip = $addr_split[0]; $port = $addr_split[1]; diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index c1cf525..a1a2c73 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -329,7 +329,7 @@ function get_carp_status() { */ function convert_ip_to_network_format($ip, $subnet) { - $ipsplit = split('[.]', $ip); + $ipsplit = explode('[.]', $ip); $string = $ipsplit[0] . "." . $ipsplit[1] . "." . $ipsplit[2] . ".0/" . $subnet; return $string; } @@ -898,7 +898,7 @@ function auto_login() { $status = true; $gettytab = file_get_contents("/etc/gettytab"); - $getty_split = split("\n", $gettytab); + $getty_split = explode("\n", $gettytab); conf_mount_rw(); $fd = false; $tries = 0; @@ -942,7 +942,7 @@ function setup_serial_port($when="save", $path="") { $boot_config = ""; if($g['platform'] <> "cdrom") { - $boot_config_split = split("\n", $boot_config); + $boot_config_split = explode("\n", $boot_config); $fd = fopen($boot_config_file,"w"); if($fd) { foreach($boot_config_split as $bcs) { @@ -986,7 +986,7 @@ function setup_serial_port($when="save", $path="") { } } $ttys = file_get_contents("/etc/ttys"); - $ttys_split = split("\n", $ttys); + $ttys_split = explode("\n", $ttys); $fd = fopen("/etc/ttys", "w"); foreach($ttys_split as $tty) { if(stristr($tty, "ttyd0") or stristr($tty, "ttyu0")) { @@ -1597,6 +1597,7 @@ function update_progress_bar($percent) { /* Split() is being DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged. */ if(!function_exists("split")) { function split($seperator, $haystack, $limit = null) { + log_error("deprecated split() call with seperator '{$seperator}'"); return preg_split($seperator, $haystack, $limit); } } @@ -1669,11 +1670,11 @@ function update_alias_url_data() { if(file_exists("{$temp_filename}/aliases")) { $file_contents = file_get_contents("{$temp_filename}/aliases"); $file_contents = str_replace("#", "\n#", $file_contents); - $file_contents_split = split("\n", $file_contents); + $file_contents_split = explode("\n", $file_contents); foreach($file_contents_split as $fc) { $tmp = trim($fc); if(stristr($fc, "#")) { - $tmp_split = split("#", $tmp); + $tmp_split = explode("#", $tmp); $tmp = trim($tmp_split[0]); } if(trim($tmp) <> "") { diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 95de0f7..8f60e61 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -479,7 +479,7 @@ function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url = $filename = str_replace("\n", " ", $filename); $filename = str_replace(" ", " ", $filename); - $pkgs = split(" ", $filename); + $pkgs = explode(" ", $filename); foreach($pkgs as $filename) { $filename = trim($filename); if (($g['platform'] == "nanobsd") || ($g['platform'] == "embedded")) { diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 595b87a..1126473 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -1876,7 +1876,7 @@ function upgrade_053_to_054() { $gateway_group['item'] = array(); $i = 0; foreach($lbpool['servers'] as $member) { - $split = split("\|", $member); + $split = explode("\|", $member); $interface = $split[0]; $monitor = $split[1]; /* on static upgraded configuration we automatically prepend GW_ */ diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc index dc7f613..b3bc5a4 100644 --- a/etc/inc/voucher.inc +++ b/etc/inc/voucher.inc @@ -213,7 +213,7 @@ function voucher_expire($voucher_received) { } // split into an array. Useful for multiple vouchers given - $a_vouchers_received = split("[\t\n\r ]+",$voucher_received); + $a_vouchers_received = preg_split("/[\t\n\r ]+/s", $voucher_received); $active_dirty = false; $cpdb = captiveportal_read_db(false, 4); /* Indexed by Voucher */ @@ -329,7 +329,7 @@ function voucher_auth($voucher_received, $test = 0) { } // split into an array. Useful for multiple vouchers given - $a_vouchers_received = split("[\t\n\r ]+",$voucher_received); + $a_vouchers_received = preg_split("/[\t\n\r ]+/s", $voucher_received); $error = 0; $test_result = array(); // used to display for voucher test option in GUI $total_minutes = 0; diff --git a/etc/inc/vslb.inc b/etc/inc/vslb.inc index fc00d3d..71ea75f 100644 --- a/etc/inc/vslb.inc +++ b/etc/inc/vslb.inc @@ -385,7 +385,7 @@ function get_lb_summary() { exec('/usr/local/sbin/relayctl show summary 2>&1', $relayctl); $relay_hosts=Array(); foreach( (array) $relayctl as $line) { - $t=split("\t", $line); + $t = explode("\t", $line); switch (trim($t[1])) { case "table": $curpool=trim($t[2]); |