Fix rrd_name escaping * used with glob()

Thanks tuxis-ie for finding the issue and fix.
This commit is contained in:
Tony Murray
2016-08-12 14:42:57 -05:00
parent 8eced98439
commit 5db9256baf
8 changed files with 11 additions and 11 deletions

View File

@@ -21,7 +21,7 @@ $colour_area_in = 'CDEB8B';
$colour_area_out = 'C3D9FF';
$rrd_list = array();
$rrd_filenames = glob(rrd_name($device['hostname'], array('app', 'shoutcast', $app['app_id'], '*')));
$rrd_filenames = glob(rrd_name($device['hostname'], array('app', 'shoutcast', $app['app_id']), '*.rrd'));
foreach ($rrd_filenames as $file) {
$pieces = explode('-', basename($file, '.rrd'));
$hostname = end($pieces);

View File

@@ -8,7 +8,7 @@ $total_text = 'Total of all ShoutCast Servers';
$nototal = 0;
$rrd_list = array();
$rrd_filenames = glob(rrd_name($device['hostname'], array('app', 'shoutcast', $app['app_id'], '*')));
$rrd_filenames = glob(rrd_name($device['hostname'], array('app', 'shoutcast', $app['app_id']), '*.rrd'));
foreach ($rrd_filenames as $file) {
$pieces = explode('-', basename($file, '.rrd'));
$hostname = end($pieces);

View File

@@ -24,7 +24,7 @@ $pallette = array(
$rrd_options .= ' -l 0 -E ';
$rrd_options .= " COMMENT:'Average Data Rate Cur Min Max\\n'";
$radioId=1;
foreach(glob(rrd_name($device['hostname'], 'xirrus_stats-*')) as $rrd) {
foreach(glob(rrd_name($device['hostname'], 'xirrus_stats-', '*.rrd')) as $rrd) {
// get radio name
preg_match("/xirrus_stats-iap([0-9]{1,2}).rrd/", $rrd, $out);
list(,$radioId)=$out;

View File

@@ -24,7 +24,7 @@ $pallette = array(
$rrd_options .= ' -E ';
$rrd_options .= " COMMENT:'Noisefloor Cur Min Max\\n'";
$radioId=1;
foreach(glob(rrd_name($device['hostname'], 'xirrus_stats-*')) as $rrd) {
foreach(glob(rrd_name($device['hostname'], 'xirrus_stats-', '*.rrd')) as $rrd) {
// get radio name
preg_match("/xirrus_stats-iap([0-9]{1,2}).rrd/", $rrd, $out);
list(,$radioId)=$out;

View File

@@ -24,7 +24,7 @@ $pallette = array(
$rrd_options .= ' -E ';
$rrd_options .= " COMMENT:'Signal RSSI Cur Min Max\\n'";
$radioId=1;
foreach(glob(rrd_name($device['hostname'], 'xirrus_stats-*')) as $rrd) {
foreach(glob(rrd_name($device['hostname'], 'xirrus_stats-', '*.rrd')) as $rrd) {
// get radio name
preg_match("/xirrus_stats-iap([0-9]{1,2}).rrd/", $rrd, $out);
list(,$radioId)=$out;

View File

@@ -24,7 +24,7 @@ $pallette = array(
$rrd_options .= ' -l 0 -E ';
$rrd_options .= " COMMENT:'Associated Stations Cur Min Max\\n'";
$radioId=1;
foreach(glob(rrd_name($device['hostname'], 'xirrus_users-*')) as $rrd) {
foreach(glob(rrd_name($device['hostname'], 'xirrus_users-', '*.rrd')) as $rrd) {
// get radio name
preg_match("/xirrus_users-iap([0-9]{1,2}).rrd/", $rrd, $out);
list(,$radioId)=$out;