X-Git-Url: https://git-public.kairo.at/?a=blobdiff_plain;f=classes%2Frrdstat.php-class;h=f0a89aa7a38fe142501df8eabe4d57cb72732573;hb=HEAD;hp=2770af766260234dda7d1040df3bdf5946c54286;hpb=97472ddcd376ade81ef3bed3ab2ca2b0dd0b048f;p=php-utility-classes.git diff --git a/classes/rrdstat.php-class b/classes/rrdstat.php-class index 2770af7..9743e7a 100644 --- a/classes/rrdstat.php-class +++ b/classes/rrdstat.php-class @@ -496,7 +496,7 @@ class rrdstat { // assemble configuration $gconf = (array)$extra; - if (!is_null($sub) && is_array($this->config_raw['graph.'.$sub])) { + if (!is_null($sub) && array_key_exists('graph.'.$sub, $this->config_raw) && is_array($this->config_raw['graph.'.$sub])) { $gconf = $gconf + $this->config_raw['graph.'.$sub]; } $gconf = $gconf + (array)$this->config_graph; @@ -576,7 +576,7 @@ class rrdstat { } foreach (array('scale_time_src','scale_time_tgt') as $st) { if (!isset($erow[$st]) || !is_numeric($erow[$st])) { - switch (@$erow[$st]) { + switch ($erow[$st] ?? null) { case 'dyn': case 'auto': $erow[$st] = $slice; @@ -785,7 +785,7 @@ class rrdstat { $legendlines = ''; foreach ($graphrows as $grow) { $legendline = isset($grow['desc'])?$grow['desc']:(isset($grow['legend'])?$grow['legend']:$grow['name']); - $legendline .= '|'.@$grow['color']; + $legendline .= '|'.($grow['color'] ?? ''); $legendline .= '|'.(isset($grow['color_bg'])?$grow['color_bg']:''); $legendline .= '|'.(isset($grow['legend_long'])?$grow['legend_long']:''); $legendlines .= 'legend:'.$legendline."\n"; @@ -845,7 +845,7 @@ class rrdstat { $pconf = $pconf + (array)$this->config_page; $return = null; - switch (@$pconf['type']) { + switch ($pconf['type'] ?? null) { case 'index': $return = $this->page_index($pconf); break; @@ -971,9 +971,9 @@ class rrdstat { if (isset($pconf['stats_url_add'])) { $sURL_add = $pconf['stats_url_add']; } else { $sURL_add = '&sub=%s'; } - $default_num_cols = $GLOBALS['ua']->isMobile()?1:2; - $num_cols = is_numeric(@$pconf['num_rows'])?$pconf['num_rows']:$default_num_cols; - $num_rows = ceil(count($stats)/$num_cols); + $default_num_cols = $GLOBALS['ua']->isMobile() ? 1 : 2; + $num_cols = is_numeric($pconf['num_rows'] ?? null) ? $pconf['num_rows'] : $default_num_cols; + $num_rows = ceil(count($stats) / $num_cols); $out .= '