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 --- create_thread.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'create_thread.php') diff --git a/create_thread.php b/create_thread.php index 6fb7df9..a203b39 100644 --- a/create_thread.php +++ b/create_thread.php @@ -10,6 +10,7 @@

Create a new thread

is_signed_in()) { trigger_error('You must be signed in to create a thread.'); exit(); @@ -44,6 +45,7 @@ if (!Session::get()->is_signed_in()) { Date: Thu, 13 May 2021 22:27:06 -0600 Subject: Disallow empty post content when creating threads --- create_thread.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'create_thread.php') diff --git a/create_thread.php b/create_thread.php index a203b39..976bd9f 100644 --- a/create_thread.php +++ b/create_thread.php @@ -27,7 +27,7 @@ if (!Session::get()->is_signed_in()) { $categories = get_all_categories(); if (count($categories) == 0) { - echo 'There are no categories to post to!'; + trigger_error('There are no categories to post to!'); } else { echo '