-function ttrss_error_handler($errno, $errstr, $file, $line, $context) {
- global $logger;
+function format_backtrace($trace) {
+ $rv = "";
+ $idx = 1;
+
+ if (is_array($trace)) {
+ foreach ($trace as $e) {
+ if (isset($e["file"]) && isset($e["line"])) {
+ $fmt_args = [];
+
+ if (is_array($e["args"])) {
+ foreach ($e["args"] as $a) {
+ if (!is_object($a)) {
+ array_push($fmt_args, $a);
+ } else {
+ array_push($fmt_args, "[" . get_class($a) . "]");
+ }
+ }
+ }
+
+ $filename = str_replace(dirname(__DIR__) . "/", "", $e["file"]);