From cfbfd9412b70bda8c34127b8b7dfdceff4872390 Mon Sep 17 00:00:00 2001 From: smos Date: Thu, 19 Jan 2012 20:33:41 +0100 Subject: 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 --- usr/local/captiveportal/index.php | 2 +- usr/local/sbin/pfSsh.php | 8 ++++---- usr/local/www/diag_backup.php | 4 ++-- usr/local/www/diag_dns.php | 4 ++-- usr/local/www/diag_dump_states.php | 4 ++-- usr/local/www/firewall_aliases_edit.php | 4 ++-- usr/local/www/firewall_nat.php | 2 +- usr/local/www/firewall_virtual_ip_edit.php | 2 +- usr/local/www/installer/installer.php | 20 ++++++++++---------- usr/local/www/interfaces.php | 2 +- usr/local/www/interfaces_ppps_edit.php | 2 +- usr/local/www/services_dyndns.php | 2 +- usr/local/www/status_rrd_graph.php | 8 ++++---- usr/local/www/status_rrd_graph_img.php | 2 +- usr/local/www/system.php | 2 +- usr/local/www/system_firmware_settings.php | 4 ++-- usr/local/www/widgets/widgets/picture.widget.php | 2 +- usr/local/www/widgets/widgets/rss.widget.php | 2 +- usr/local/www/wizard.php | 6 +++--- usr/local/www/wizards/setup_wizard.xml | 4 ++-- 20 files changed, 43 insertions(+), 43 deletions(-) (limited to 'usr/local') diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php index 040b6bb..3629f15 100755 --- a/usr/local/captiveportal/index.php +++ b/usr/local/captiveportal/index.php @@ -147,7 +147,7 @@ EOD; // $timecredit contains either a credit in minutes or an error message if ($timecredit > 0) { // voucher is valid. Remaining minutes returned // if multiple vouchers given, use the first as username - $a_vouchers = split("[\t\n\r ]+",$voucher); + $a_vouchers = explode("[\t\n\r ]+",$voucher); $voucher = $a_vouchers[0]; $attr = array( 'voucher' => 1, 'session_timeout' => $timecredit*60, diff --git a/usr/local/sbin/pfSsh.php b/usr/local/sbin/pfSsh.php index a73e7de..ac4a56a 100755 --- a/usr/local/sbin/pfSsh.php +++ b/usr/local/sbin/pfSsh.php @@ -56,7 +56,7 @@ if(!function_exists("readline")) { function more($text, $count=24) { $counter=0; - $lines = split("\n", $text); + $lines = explode("\n", $text); foreach($lines as $line) { if($counter > $count) { echo "Press RETURN to continue ..."; @@ -211,7 +211,7 @@ $tccommands[] = "RELENG_1_2"; while($shell_active == true) { $command = readline("{$g['product_name']} shell: "); readline_add_history($command); - $command_split = split(" ", $command); + $command_split = explode(" ", $command); $first_command = $command_split[0]; if($first_command == "playback" || $first_command == "run") { $playback_file = $command_split[1]; @@ -310,7 +310,7 @@ function str_replace_all($search,$replace,$subject) { } function playback_text($playback_file_contents) { - $playback_file_split = split("\n", $playback_file_contents); + $playback_file_split = explode("\n", $playback_file_contents); $playback_text = "require_once('functions.inc');\n"; $playback_text .= "require_once('globals.inc');\n"; $playback_text .= "require_once('config.inc');\n"; @@ -339,4 +339,4 @@ function playback_file($playback_file) { playback_text($playback_file_contents); } -?> \ No newline at end of file +?> diff --git a/usr/local/www/diag_backup.php b/usr/local/www/diag_backup.php index 9d28375..6efb1ff 100755 --- a/usr/local/www/diag_backup.php +++ b/usr/local/www/diag_backup.php @@ -57,7 +57,7 @@ require_once("shaper.inc"); function add_base_packages_menu_items() { global $g, $config; - $base_packages = split($g['base_packages'], ","); + $base_packages = explode($g['base_packages'], ","); $modified_config = false; foreach($base_packages as $bp) { $basepkg_path = "/usr/local/pkg/{$bp}"; @@ -226,7 +226,7 @@ if ($_POST) { */ if(!$_POST['donotbackuprrd']) { $data = str_replace("", "\t", $data); - $rrd_files_var_db_rrd = split("\n",`cd /var/db/rrd && ls *.rrd`); + $rrd_files_var_db_rrd = explode("\n",`cd /var/db/rrd && ls *.rrd`); foreach($rrd_files_var_db_rrd as $rrd) { if($rrd) { $rrd_data = file_get_contents("{$g['vardb_path']}/rrd/{$rrd}"); diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index cf5c397..63c119a 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -48,7 +48,7 @@ if($_GET['createalias'] == "true") { if($resolved) { $host = trim($_POST['host']); $dig=`dig "$host" A | grep "$host" | grep -v ";" | awk '{ print $5 }'`; - $resolved = split("\n", $dig); + $resolved = explode("\n", $dig); $isfirst = true; foreach($resolved as $re) { if($re <> "") { @@ -132,7 +132,7 @@ if ($_POST) { $resolved = gethostbyname($host); if($resolved) { $dig=`dig $host_esc A | grep $host_esc | grep -v ";" | awk '{ print $5 }'`; - $resolved = split("\n", $dig); + $resolved = explode("\n", $dig); } $hostname = $host; if ($host != $resolved) diff --git a/usr/local/www/diag_dump_states.php b/usr/local/www/diag_dump_states.php index 5ed855d..b368542 100755 --- a/usr/local/www/diag_dump_states.php +++ b/usr/local/www/diag_dump_states.php @@ -187,9 +187,9 @@ if(count($states) > 0) { /* break up info and extract $srcip and $dstip */ $ends = preg_split("/\?/", $info); - $parts = split(":", $ends[0]); + $parts = explode(":", $ends[0]); $srcip = trim($parts[0]); - $parts = split(":", $ends[count($ends) - 1]); + $parts = explode(":", $ends[count($ends) - 1]); $dstip = trim($parts[0]); echo " diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php index 6413c8f..9263955 100755 --- a/usr/local/www/firewall_aliases_edit.php +++ b/usr/local/www/firewall_aliases_edit.php @@ -213,14 +213,14 @@ if ($_POST) { 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) { // Stop at 3000 items, aliases larger than that tend to break both pf and the WebGUI. if ($address_count >= 3000) break; $tmp = trim($fc); if(stristr($fc, "#")) { - $tmp_split = split("#", $tmp); + $tmp_split = explode("#", $tmp); $tmp = trim($tmp_split[0]); } $tmp = trim($tmp); diff --git a/usr/local/www/firewall_nat.php b/usr/local/www/firewall_nat.php index d2a9caa..0d92d1a 100755 --- a/usr/local/www/firewall_nat.php +++ b/usr/local/www/firewall_nat.php @@ -290,7 +290,7 @@ echo "