From 3f11e7637e2227174082992678429be723602ed5 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Fri, 12 May 2017 19:44:44 +0000 Subject: [PATCH] backtrace: check the parameter before use it git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3659 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- backtrace.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backtrace.php b/backtrace.php index 49addbd..c2dd8ec 100644 --- a/backtrace.php +++ b/backtrace.php @@ -6,9 +6,12 @@ class backtrace { /** Display the backtrace in the browser * use: \backtrace::show (debug_backtrace ()); + * @param array $backtrace The backtrace to display */ public static function show ($backtrace) { + if (! is_array ($backtrace)) + throw new \Exception ("Backtrace invalid: not an array", 500); echo "
Debug BackTrace:\n";
     foreach ($backtrace as $key=>$back)
     {