From 4145fa13230d25d9978c003a8cccd1b7c2e11aaf Mon Sep 17 00:00:00 2001 From: h5p9sl <21267024+h5p9sl@users.noreply.github.com> Date: Thu, 13 May 2021 21:02:43 -0600 Subject: Clean up HTML; no functional changes --- includes/templates/header.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'includes') diff --git a/includes/templates/header.php b/includes/templates/header.php index 1db9cda..5070cfe 100644 --- a/includes/templates/header.php +++ b/includes/templates/header.php @@ -1,4 +1,6 @@ +

cflip.net forumbeta

+

[Home] [All Threads] [All Posts] @@ -16,3 +18,5 @@ } ?> +

+
-- cgit v1.2.3 From fe41f57df59c7f2a11d80eaaebf08d3a3a51a6d5 Mon Sep 17 00:00:00 2001 From: h5p9sl <21267024+h5p9sl@users.noreply.github.com> Date: Thu, 13 May 2021 22:07:11 -0600 Subject: Add error handling --- includes/Session.php | 2 +- includes/error.php | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 includes/error.php (limited to 'includes') diff --git a/includes/Session.php b/includes/Session.php index 7951d70..ceaa765 100644 --- a/includes/Session.php +++ b/includes/Session.php @@ -54,4 +54,4 @@ class Session return $result; } -} \ No newline at end of file +} diff --git a/includes/error.php b/includes/error.php new file mode 100644 index 0000000..5e33212 --- /dev/null +++ b/includes/error.php @@ -0,0 +1,25 @@ +'. $message .'

'; +} + +function handle_error($errno, $errstr, $errfile, $errline) { + if (!(error_reporting() & $errno)) { + // This error code is not included in error_reporting, so let it fall + // through to the standard PHP error handler + return false; + } + + switch ($errno) { + // See https://www.php.net/manual/en/errorfunc.constants.php + case E_USER_NOTICE: + user_notice($errstr); + break; + default: + return false; + } + return true; +} + +$old_error_handler = set_error_handler('handle_error'); +?> -- cgit v1.2.3