From 24efe49bc2b545e3a3e46d7d6f2bd1166163e52b Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Sat, 5 Jun 2021 11:18:10 -0600 Subject: Move object related functions into their classes. Some of the pages are still broken from this commit, but I plan to either rewrite or ignore them. --- viewuser.php | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'viewuser.php') diff --git a/viewuser.php b/viewuser.php index 45f557a..de40d6f 100644 --- a/viewuser.php +++ b/viewuser.php @@ -3,22 +3,29 @@ include_once './includes/model/User.php'; session_start(); -$current = new User(); +if (!isset($_GET['id']) or !filter_var($_GET['id'], FILTER_VALIDATE_INT)) { + http_response_code(404); + include('includes/templates/404.php'); + die(); +} -if (!isset($_GET['id'])) { -} else { - $current->get_by_id($_GET['id']); +$current = new User(); +$current->get_by_id($_GET['id']); +if (!$current->has_value()) { + http_response_code(404); + include('includes/templates/404.php'); + die(); } ?>
-