From d4429a7d8e93de864851b73da934279e3b0b5b1c Mon Sep 17 00:00:00 2001
From: Marius Burkard <m.burkard@pixcept.de>
Date: Sat, 19 Mar 2022 20:59:09 +0000
Subject: [PATCH] Good point; I'd even use `!empty($caller['file']) &&
 !empty($caller['line'])` to save a few cycles in the (improbable) case where
 both _may_ be set, but empty (thus making the whole exercise pointless...).

---
 server/lib/app.inc.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/server/lib/app.inc.php b/server/lib/app.inc.php
index e4fb8bb24e..526ce3060e 100644
--- a/server/lib/app.inc.php
+++ b/server/lib/app.inc.php
@@ -251,7 +251,9 @@ class app {
 				$priority_txt = 'DEBUG';
 				$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);	// we don't need _all_ data, so we save some processing time here (gwyneth 20220315)
 				$caller = array_shift($bt);
-				$file_line_caller = '[' . strtr(basename($caller['file'], '.php'), '_', ' ') . ':' . $caller['line'] . '] ';
+				if(isset($caller['file']) && isset($caller['line'])) {
+					$file_line_caller = '[' . strtr(basename($caller['file'], '.php'), '_', ' ') . ':' . $caller['line'] . '] ';
+				}
 				break;
 		case 1:
 				$priority_txt = 'WARNING';
-- 
GitLab