Browse code

send exception via mail only in non-debug-environments

Bernd Wurst authored on 10/04/2019 08:13:58
Showing 1 changed files
... ...
@@ -470,6 +470,12 @@ function get_modules_info()
470 470
 
471 471
 function handle_exception($e)
472 472
 {
473
-    $msg = "Exception caught:\n".$e->getMessage()."\n".serialize($_POST)."\n".serialize($_SERVER);
474
-    mail(config("adminmail"), "Exception on configinterface", $msg);
473
+    if (config('enable_debug')) {
474
+        print_r($e->getMessage());
475
+        print_r(serialize($_POST));
476
+        print_r(serialize($_SERVER));
477
+    } else {
478
+        $msg = "Exception caught:\n".$e->getMessage()."\n".serialize($_POST)."\n".serialize($_SERVER);
479
+        mail(config("adminmail"), "Exception on configinterface", $msg);
480
+    }
475 481
 }