From c35407bc94fdc24910c356914d58f539af6776e9 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 30 Sep 2018 10:18:19 +0200 Subject: [PATCH] fix undefined debug-flag if not present Signed-off-by: Michael Kaufmann --- lib/classes/database/class.Database.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/classes/database/class.Database.php b/lib/classes/database/class.Database.php index 3c1e64c3..079086f8 100644 --- a/lib/classes/database/class.Database.php +++ b/lib/classes/database/class.Database.php @@ -379,7 +379,11 @@ class Database { } if ($showerror && $json_response) { - throw new Exception($error_message.($sql['debug'] ? "\n\n".$error_trace : ''), 500); + $exception_message = $error_message; + if (isset($sql['debug']) && $sql['debug'] == true) { + $exception_message .= "\n\n".$error_trace; + } + throw new Exception($exception_message, 500); } if ($showerror) {