From 3966b589651f031710960b3667918253247f6229 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 10 Jan 2023 10:41:20 -0500 Subject: [PATCH] Only show line number if it's provided in System::callstack - Address https://github.com/friendica/friendica/issues/12488#issuecomment-1377373973 --- src/Core/System.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Core/System.php b/src/Core/System.php index 3feaac31dc..42f5ab36ae 100644 --- a/src/Core/System.php +++ b/src/Core/System.php @@ -253,12 +253,12 @@ class System $func['database'] = in_array($func['class'], ['Friendica\Database\DBA', 'Friendica\Database\Database']); if (!$previous['database'] || !$func['database']) { $classparts = explode("\\", $func['class']); - $callstack[] = array_pop($classparts).'::'.$func['function'] . '(' . $func['line'] . ')'; + $callstack[] = array_pop($classparts).'::'.$func['function'] . (isset($func['line']) ? ' (' . $func['line'] . ')' : ''); $previous = $func; } } elseif (!in_array($func['function'], $ignore)) { $func['database'] = ($func['function'] == 'q'); - $callstack[] = $func['function'] . '(' . $func['line'] . ')'; + $callstack[] = $func['function'] . (isset($func['line']) ? ' (' . $func['line'] . ')' : ''); $func['class'] = ''; $previous = $func; }