]> git.mxchange.org Git - friendica.git/commitdiff
Only show line number if it's provided in System::callstack
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 10 Jan 2023 15:41:20 +0000 (10:41 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 10 Jan 2023 15:41:20 +0000 (10:41 -0500)
- Address https://github.com/friendica/friendica/issues/12488#issuecomment-1377373973

src/Core/System.php

index 3feaac31dc7e37cf519234832be3c01cc1792e69..42f5ab36aef2c85e001dfe60ddbf337405648d9a 100644 (file)
@@ -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;
                        }