From cb2420c657c2856403afada65712063542b145c0 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sun, 21 Feb 2021 16:23:20 +0100 Subject: [PATCH] fix string array access --- classes/document.php-class | 3 +-- classes/rrdstat.php-class | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/classes/document.php-class b/classes/document.php-class index a0800f2..198296f 100755 --- a/classes/document.php-class +++ b/classes/document.php-class @@ -173,8 +173,7 @@ class ExtendedDocument extends DOMDocument { // returns an ExtendedElement that is an HTML with the given src and alt attributes (set to '' by default) // // public function createElementForm($action, $method, $name) - // returns an ExtendedElement that is an HTML
that is a child of an HTML
- // with the given action, method, and name + // returns an ExtendedElement that is an HTML with the given action, method, and name // // public function createElementInputHidden($name, $value) // returns an ExtendedElement that is an HTML of type 'hidden' with the given name and value diff --git a/classes/rrdstat.php-class b/classes/rrdstat.php-class index 0a71f13..a6b8e9c 100644 --- a/classes/rrdstat.php-class +++ b/classes/rrdstat.php-class @@ -206,11 +206,11 @@ class rrdstat { $this->status = 'graphonly'; } elseif (isset($iinfo['file'])) { - $this->rrd_file = (($iinfo['file']{0} != '/')?$this->basedir:'').$iinfo['file']; + $this->rrd_file = (($iinfo['file'][0] != '/')?$this->basedir:'').$iinfo['file']; $this->basename = basename((substr($this->rrd_file, -4) == '.rrd')?substr($this->rrd_file, 0, -4):$this->rrd_file); } elseif (!is_null($conf_id) && file_exists($conf_id.'.rrd')) { - $this->rrd_file = (($iinfo['file']{0} != '/')?$this->basedir:'').$conf_id.'.rrd'; + $this->rrd_file = (($iinfo['file'][0] != '/')?$this->basedir:'').$conf_id.'.rrd'; $this->basename = $conf_id; } else { @@ -509,8 +509,8 @@ class rrdstat { $fname = str_replace('%t', $timeframe, $fname); $fname = str_replace('%f', $fmt_ext, $fname); if (substr($fname, -strlen($fmt_ext)) != $fmt_ext) { $fname .= $fmt_ext; } - if (isset($gconf['path']) && ($fname{0} != '/')) { $fname = $gconf['path'].'/'.$fname; } - if ($fname{0} != '/') { $fname = $this->basedir.$fname; } + if (isset($gconf['path']) && ($fname[0] != '/')) { $fname = $gconf['path'].'/'.$fname; } + if ($fname[0] != '/') { $fname = $this->basedir.$fname; } $fname = str_replace('//', '/', $fname); $graphrows = array(); $specialrows = array(); $gC = 0; @@ -1178,7 +1178,7 @@ class rrdstat { $snames = array(); $s_exclude = array(); $sfiles = array(); if (isset($pconf['index_ids'])) { foreach (explode(',', $pconf['index_ids']) as $iid) { - if ($iid{0} == '-') { $s_exclude[] = substr($iid, 1); } + if ($iid[0] == '-') { $s_exclude[] = substr($iid, 1); } else { $snames[] = $iid; } } } -- 2.43.0