summaryrefslogtreecommitdiff
path: root/include/errorhandler.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-05 23:41:32 +0300
committerAndrew Dolgov <[email protected]>2021-02-05 23:41:32 +0300
commit403dca154c6b539de221f9e16174a0fdd0a1e896 (patch)
tree8187096f0e04ecb60440c8551514d990d0e85b2d /include/errorhandler.php
parentb4cbc792cc5fbbd5356f91038bf6cf5e67a19e42 (diff)
initial WIP for php8; bump php version requirement to 7.0
Diffstat (limited to 'include/errorhandler.php')
-rw-r--r--include/errorhandler.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/errorhandler.php b/include/errorhandler.php
index 188c8c5ce..16afcabcf 100644
--- a/include/errorhandler.php
+++ b/include/errorhandler.php
@@ -10,10 +10,12 @@ function format_backtrace($trace) {
if (is_array($e["args"])) {
foreach ($e["args"] as $a) {
- if (!is_object($a)) {
- array_push($fmt_args, $a);
- } else {
+ if (is_object($a)) {
array_push($fmt_args, "[" . get_class($a) . "]");
+ } else if (is_array($a)) {
+ array_push($fmt_args, "[" . truncate_string(json_encode($a), 128, "...")) . "]";
+ } else {
+ array_push($fmt_args, $a);
}
}
}
@@ -21,7 +23,11 @@ function format_backtrace($trace) {
$filename = str_replace(dirname(__DIR__) . "/", "", $e["file"]);
$rv .= sprintf("%d. %s(%s): %s(%s)\n",
- $idx, $filename, $e["line"], $e["function"], implode(", ", $fmt_args));
+ $idx,
+ $filename,
+ $e["line"],
+ $e["function"],
+ implode(", ", $fmt_args));
$idx++;
}