From c18c01c83f99d68220c204619093e2a8f0c75430 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Thu, 7 Jul 2016 21:57:18 -0500 Subject: [PATCH] Fix scrut issues, pass by reference --- html/includes/graphs/application/shoutcast_multi_bits.inc.php | 3 ++- html/includes/graphs/application/shoutcast_multi_stats.inc.php | 3 ++- html/pages/device/apps/shoutcast.inc.php | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/html/includes/graphs/application/shoutcast_multi_bits.inc.php b/html/includes/graphs/application/shoutcast_multi_bits.inc.php index 5ee3c4c5e1..cd193c6bf9 100644 --- a/html/includes/graphs/application/shoutcast_multi_bits.inc.php +++ b/html/includes/graphs/application/shoutcast_multi_bits.inc.php @@ -23,7 +23,8 @@ $colour_area_out = 'C3D9FF'; $rrd_list = array(); $rrd_filenames = glob(rrd_name($device['hostname'], array('app', 'shoutcast', $app['app_id'], '*'))); foreach ($rrd_filenames as $file) { - $hostname = end(explode('-',basename($file, '.rrd'))); + $pieces = explode('-', basename($file, '.rrd')); + $hostname = end($pieces); list($host, $port) = explode('_', $hostname, 2); $rrd_list[] = array( 'filename' => $file, diff --git a/html/includes/graphs/application/shoutcast_multi_stats.inc.php b/html/includes/graphs/application/shoutcast_multi_stats.inc.php index 77d132c14c..3a72450623 100644 --- a/html/includes/graphs/application/shoutcast_multi_stats.inc.php +++ b/html/includes/graphs/application/shoutcast_multi_stats.inc.php @@ -10,7 +10,8 @@ $nototal = 0; $rrd_list = array(); $rrd_filenames = glob(rrd_name($device['hostname'], array('app', 'shoutcast', $app['app_id'], '*'))); foreach ($rrd_filenames as $file) { - $hostname = end(explode('-',basename($file, '.rrd'))); + $pieces = explode('-', basename($file, '.rrd')); + $hostname = end($pieces); list($host, $port) = explode('_', $hostname, 2); $rrd_list[] = array( 'filename' => $file, diff --git a/html/pages/device/apps/shoutcast.inc.php b/html/pages/device/apps/shoutcast.inc.php index dca8b5cca2..75f37d99e8 100644 --- a/html/pages/device/apps/shoutcast.inc.php +++ b/html/pages/device/apps/shoutcast.inc.php @@ -33,7 +33,8 @@ if (isset($total) && $total === true) { $files = glob(rrd_name($device['hostname'], array('app', 'shoutcast', $app['app_id'], '*'))); foreach ($files as $file) { - $hostname = end(explode('-',basename($file, '.rrd'))); + $pieces = explode('-', basename($file, '.rrd')); + $hostname = end($pieces); list($host, $port) = explode('_', $hostname, 2); $graphs = array( 'shoutcast_bits' => 'Traffic Statistics - '.$host.' (Port: '.$port.')',