From d25b72d1e59591449d5efeea4b4063d250ebb1a8 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Wed, 13 Sep 2017 17:16:03 +0200 Subject: [PATCH] page: return 500 status and page on php exceptions Significantly catch syntax errors in editor saves. --- 500.php | 8 ++++++++ page.php | 5 +++++ 2 files changed, 13 insertions(+) create mode 100644 500.php diff --git a/500.php b/500.php new file mode 100644 index 0000000..a3e261c --- /dev/null +++ b/500.php @@ -0,0 +1,8 @@ + +

Scriptfout

+ +

Er ging iets mis:

+Waarschijnlijk wordt hier aan gewerkt, maar als het probleem aanhoudt +geef het dan aan ons door. diff --git a/page.php b/page.php index f6c2346..9acacc2 100644 --- a/page.php +++ b/page.php @@ -2,6 +2,11 @@ error_reporting(E_ALL); ini_set('display_errors', TRUE); +set_exception_handler(function ($error) { + include_once 'page.inc.php'; + include_once '500.php'; +}); + include_once 'auth.inc.php'; $Edit = isset($_GET['edit']); -- 2.30.0