diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2020-04-17 10:25:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-17 10:25:16 +0300 |
commit | b6b7c284d472f5c197fab66a75814cfe346546a8 (patch) | |
tree | 1970d7ee66c46c8709be1929bff34f4bec8566bc /plugins/Monolog | |
parent | 37182bfda5529ddb4ba2aaedd09beb1e5ae94fbb (diff) |
Prevent possible notice and hiding actual error in debug trace (#15818)
* Prevent possible notice and hiding actual error in debug trace
refs https://forum.matomo.org/t/empty-or-invalid-response-php-notice-undefined-index-class-when-archiving/36908/2
* Update plugins/Monolog/Formatter/LineMessageFormatter.php
Co-Authored-By: Stefan Giehl <stefan@matomo.org>
Co-authored-by: Stefan Giehl <stefan@matomo.org>
Diffstat (limited to 'plugins/Monolog')
-rw-r--r-- | plugins/Monolog/Formatter/LineMessageFormatter.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/Monolog/Formatter/LineMessageFormatter.php b/plugins/Monolog/Formatter/LineMessageFormatter.php index e0e43663b5..3d79139280 100644 --- a/plugins/Monolog/Formatter/LineMessageFormatter.php +++ b/plugins/Monolog/Formatter/LineMessageFormatter.php @@ -81,12 +81,15 @@ class LineMessageFormatter implements FormatterInterface } $level = $trace[$i]; + $levelTrace = ''; if (isset($level['file'], $level['line'])) { $levelTrace = '#' . $i . (str_replace(PIWIK_DOCUMENT_ROOT, '', $level['file'])) . '(' . $level['line'] . ')'; - } else { + } elseif (isset($level['class'], $level['type'], $level['function'])) { $levelTrace = '[internal function]: ' . $level['class'] . $level['type'] . $level['function'] . '()'; } - $strTrace .= $levelTrace . ","; + if ($levelTrace) { + $strTrace .= $levelTrace . ","; + } } return trim($strTrace, ","); } |