From ab73602b3caad8f6adad9d8ddcd8c6a3946073c2 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 5 Mar 2006 20:36:28 +0000 Subject: [PATCH] Fixing format_debug_trace() so we don't get warnings when we have arrays as args --- kernel.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/kernel.php b/kernel.php index 4a61ee2..246a18d 100644 --- a/kernel.php +++ b/kernel.php @@ -724,9 +724,22 @@ class ISSO $trace = array(); foreach ($backtrace AS $i => $step) { + $args = ''; $file = $step['file'] . ':' . $step['line']; $funct = (isset($step['class']) ? $step['class'] . '::' . $step['function'] : $step['function']); - $args = (is_array($step['args']) ? implode(', ', $step['args']) : ''); + + if (isset($step['args']) AND is_array($step['args'])) + { + // we need to do this so we don't get "Array to string conversion" notices + foreach ($step['args'] AS $id => $arg) + { + if (is_array($arg)) + { + $step['args']["$id"] = 'Array'; + } + } + $args = implode(', ', $step['args']); + } $trace[] = "#$i $funct($args) called at [$file]"; } -- 2.22.5