diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-02-03 22:32:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-03 22:32:07 +0300 |
commit | ce896ba7665665c5435e89b536cc51b474fe6c76 (patch) | |
tree | e1126f8548841679495db204a3daaa0ac8f6221c /core/Plugin/Report.php | |
parent | 4dc777fe986fe3c94c54983feaebf410cf912046 (diff) |
Fix possible undefined index notice (#15502)
Diffstat (limited to 'core/Plugin/Report.php')
-rw-r--r-- | core/Plugin/Report.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/Plugin/Report.php b/core/Plugin/Report.php index 391ae994d5..740eed1853 100644 --- a/core/Plugin/Report.php +++ b/core/Plugin/Report.php @@ -496,8 +496,8 @@ class Report } elseif ($metric instanceof Metric) { $name = $metric->getName(); $metricDocs = $metric->getDocumentation(); - if (empty($metricDocs)) { - $metricDocs = @$translations[$name]; + if (empty($metricDocs) && !empty($translations[$name])) { + $metricDocs = $translations[$name]; } if (!empty($metricDocs)) { @@ -513,8 +513,8 @@ class Report } elseif ($processedMetric instanceof Metric) { $name = $processedMetric->getName(); $metricDocs = $processedMetric->getDocumentation(); - if (empty($metricDocs)) { - $metricDocs = @$translations[$name]; + if (empty($metricDocs) && !empty($translations[$name])) { + $metricDocs = $translations[$name]; } if (!empty($metricDocs)) { |