From b98ba8c1a452982e496dca8a4b9ce0d5dc8f4fa7 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Sun, 24 Apr 2016 01:05:14 -0500 Subject: [PATCH] Remove some deprecated functions --- .../graphs/application/shoutcast_multi_bits.inc.php | 6 +++--- .../graphs/application/shoutcast_multi_stats.inc.php | 6 +++--- html/pages/device/apps/shoutcast.inc.php | 6 +++--- html/pages/front/map.php | 4 +--- includes/common.php | 4 ++-- irc.php | 2 +- scripts/ntpd-server.php | 2 +- 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/html/includes/graphs/application/shoutcast_multi_bits.inc.php b/html/includes/graphs/application/shoutcast_multi_bits.inc.php index a54d6b8d5a8c..1cadfa439ecb 100644 --- a/html/includes/graphs/application/shoutcast_multi_bits.inc.php +++ b/html/includes/graphs/application/shoutcast_multi_bits.inc.php @@ -27,7 +27,7 @@ if ($handle = opendir($rrddir)) { while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..') { - if (eregi('app-shoutcast-'.$app['app_id'], $file)) { + if (stripos($file, 'app-shoutcast-'.$app['app_id'])) { array_push($files, $file); } } @@ -35,8 +35,8 @@ } foreach ($files as $id => $file) { - $hostname = eregi_replace('app-shoutcast-'.$app['app_id'].'-', '', $file); - $hostname = eregi_replace('.rrd', '', $hostname); + $hostname = str_ireplace('app-shoutcast-'.$app['app_id'].'-', '', $file); + $hostname = str_ireplace('.rrd', '', $hostname); list($host, $port) = explode('_', $hostname, 2); $rrd_filenames[] = $rrddir.'/'.$file; $rrd_list[$i]['filename'] = $rrddir.'/'.$file; diff --git a/html/includes/graphs/application/shoutcast_multi_stats.inc.php b/html/includes/graphs/application/shoutcast_multi_stats.inc.php index a6618207e220..1af206bb8b8e 100644 --- a/html/includes/graphs/application/shoutcast_multi_stats.inc.php +++ b/html/includes/graphs/application/shoutcast_multi_stats.inc.php @@ -15,7 +15,7 @@ if ($handle = opendir($rrddir)) { while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..') { - if (eregi('app-shoutcast-'.$app['app_id'], $file)) { + if (stripos($file, 'app-shoutcast-'.$app['app_id'])) { array_push($files, $file); } } @@ -23,8 +23,8 @@ } foreach ($files as $id => $file) { - $hostname = eregi_replace('app-shoutcast-'.$app['app_id'].'-', '', $file); - $hostname = eregi_replace('.rrd', '', $hostname); + $hostname = str_ireplace('app-shoutcast-'.$app['app_id'].'-', '', $file); + $hostname = str_ireplace('.rrd', '', $hostname); list($host, $port) = explode('_', $hostname, 2); $rrd_filenames[] = $rrddir.'/'.$file; $rrd_list[$i]['filename'] = $rrddir.'/'.$file; diff --git a/html/pages/device/apps/shoutcast.inc.php b/html/pages/device/apps/shoutcast.inc.php index f2aadc7f18e0..f9278c650be9 100644 --- a/html/pages/device/apps/shoutcast.inc.php +++ b/html/pages/device/apps/shoutcast.inc.php @@ -10,7 +10,7 @@ if ($handle = opendir($rrddir)) { while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..') { - if (eregi('app-shoutcast-'.$app['app_id'], $file)) { + if (stripos($file, 'app-shoutcast-'.$app['app_id']) !== false) { array_push($files, $file); } } @@ -45,8 +45,8 @@ } foreach ($files as $id => $file) { - $hostname = eregi_replace('app-shoutcast-'.$app['app_id'].'-', '', $file); - $hostname = eregi_replace('.rrd', '', $hostname); + $hostname = str_ireplace('app-shoutcast-'.$app['app_id'].'-', '', $file); + $hostname = str_ireplace('.rrd', '', $hostname); list($host, $port) = explode('_', $hostname, 2); $graphs = array( 'shoutcast_bits' => 'Traffic Statistics - '.$host.' (Port: '.$port.')', diff --git a/html/pages/front/map.php b/html/pages/front/map.php index e2b6b1e7ce50..162c898218b8 100644 --- a/html/pages/front/map.php +++ b/html/pages/front/map.php @@ -157,7 +157,7 @@ //From default.php - This code is not part of above license. if ($config['enable_syslog']) { $sql = "SELECT *, DATE_FORMAT(timestamp, '".$config['dateformat']['mysql']['compact']."') AS date from syslog ORDER BY seq DESC LIMIT 20"; -$query = mysql_query($sql); + echo('
@@ -196,8 +196,6 @@ P.device_id AND P.user_id = " . $_SESSION['user_id'] . " ORDER BY `datetime` DESC LIMIT 0,15"; } - $data = mysql_query($query); - echo('
diff --git a/includes/common.php b/includes/common.php index 36f2a5dc2d92..a1a7ab38d566 100644 --- a/includes/common.php +++ b/includes/common.php @@ -699,8 +699,8 @@ function get_smokeping_files($device) { if ($handle = opendir($smokeping_dir)) { while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..') { - if (eregi('.rrd', $file)) { - if (eregi('~', $file)) { + if (stripos($file, '.rrd') !== false) { + if (strpos($file, '~') !== false) { list($target,$slave) = explode('~', str_replace('.rrd', '', $file)); $target = str_replace('_', '.', $target); $smokeping_files['in'][$target][$slave] = $file; diff --git a/irc.php b/irc.php index 21d2b7260b84..c1f4b7aefc99 100755 --- a/irc.php +++ b/irc.php @@ -416,7 +416,7 @@ private function log($msg) { private function chkdb() { if (!is_resource($this->sql)) { - if (($this->sql = mysql_connect($this->config['db_host'], $this->config['db_user'], $this->config['db_pass'])) != false && mysql_select_db($this->config['db_name'])) { + if (($this->sql = mysqli_connect($this->config['db_host'], $this->config['db_user'], $this->config['db_pass'])) != false && mysqli_select_db($this->sql, $this->config['db_name'])) { return true; } else { diff --git a/scripts/ntpd-server.php b/scripts/ntpd-server.php index 508ca73893cd..aba7b1ffea9e 100644 --- a/scripts/ntpd-server.php +++ b/scripts/ntpd-server.php @@ -25,7 +25,7 @@ $vars = array(); $vars2 = array(); $vars = explode(',', $cmd); -$vars2 = eregi_replace(' ', '', $cmd2); +$vars2 = str_replace(' ', '', $cmd2); $vars2 = explode("\n", $vars2);