From da13fdf4eeca265e56b6bdabe340dfb4c78acc28 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Fri, 4 Oct 2013 07:16:24 +0200 Subject: [PATCH] Prettier source file name printing --- htdocs/lib/CrashReport.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/lib/CrashReport.php b/htdocs/lib/CrashReport.php index b9c3e43..5ec8827 100644 --- a/htdocs/lib/CrashReport.php +++ b/htdocs/lib/CrashReport.php @@ -33,11 +33,7 @@ class CrashReport $ret .= htmlentities($f->function); if ($f->source_file) { - if (false === $pos = strpos($f->source_file, "indra")) - { - $ret .= " " . $f->source_file; - } - else + if (false !== $pos = strpos($f->source_file, "indra")) { $source = substr($f->source_file, $pos + 6); $source = str_replace("\\", "/", $source); @@ -45,6 +41,17 @@ class CrashReport $ret .= " (line {$f->source_line} + {$f->function_offset})"; $link = "$urlBase/indra/$source/#L{$f->source_line}"; } + else if (false !== $pos = strpos($f->source_file, "libraries")) + { + $source = substr($f->source_file, $pos); + $source = str_replace("\\", "/", $source); + $ret .= " at " . $source; + $ret .= " (line {$f->source_line} + {$f->function_offset})"; + } + else + { + $ret .= " " . $f->source_file; + } } }