Skip to content

Commit

Permalink
Fix error report generation with null context
Browse files Browse the repository at this point in the history
context may be null, which transferred as post parameter becomes
is received as empty string, but that was handled when shortening
the lines.

Signed-off-by: Maximilian Krög <maxi_kroeg@web.de>
  • Loading branch information
MoonE committed Nov 2, 2024
1 parent 90f3c58 commit 39e9f06
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions libraries/classes/ErrorReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,14 @@ public function send(array $report)
private function translateStacktrace(array $stack): array
{
foreach ($stack as &$level) {
foreach ($level['context'] as &$line) {
if (mb_strlen($line) <= 80) {
continue;
}
if (is_array($level['context'])) {
foreach ($level['context'] as &$line) {
if (mb_strlen($line) <= 80) {
continue;
}

$line = mb_substr($line, 0, 75) . '//...';
$line = mb_substr($line, 0, 75) . '//...';
}
}

[$uri, $scriptName] = $this->sanitizeUrl($level['url']);
Expand Down

0 comments on commit 39e9f06

Please sign in to comment.