From 2a528f2830538542cb50cf0dc3181205dac6d842 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Tue, 28 Mar 2023 19:21:07 +0200 Subject: [PATCH] ErrorHandling: improve argument handling for debug info `var_dump` was the wrong function to call for objects, as it would just output all object data to the output buffer... Let's generalise and use `var_export` instead :-) --- models/ErrorHandler.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/models/ErrorHandler.php b/models/ErrorHandler.php index 74ca39c6..8e55c576 100644 --- a/models/ErrorHandler.php +++ b/models/ErrorHandler.php @@ -100,10 +100,12 @@ class ErrorHandler { foreach ($call['args'] as $j => $arg) { - if (is_array($arg)) - $args[$j] = print_r($arg, true); - elseif (is_object($arg)) - $args[$j] = var_dump($arg); + // Only include the class name for objects + if (is_object($arg)) + $args[$j] = get_class($arg) . '{}'; + // Export everything else -- including arrays + else + $args[$j] = var_export($arg, true); } }