From: Robert Kaiser Date: Sun, 21 Feb 2021 15:23:20 +0000 (+0100) Subject: fix string array access X-Git-Url: https://git-public.kairo.at/?p=php-utility-classes.git;a=commitdiff_plain;h=cb2420c657c2856403afada65712063542b145c0 fix string array access --- 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; } } }