From 7d39dd058b8a31bf287ee3ed6c3c6c800fbf89a3 Mon Sep 17 00:00:00 2001 From: TheN008 Date: Mon, 13 Aug 2018 12:30:31 +0530 Subject: [PATCH] Fixed a small bug --- view/functions.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/view/functions.php b/view/functions.php index d228c81..98207e7 100644 --- a/view/functions.php +++ b/view/functions.php @@ -367,7 +367,12 @@ function solved($problem_id, $user_id){ } function owns_problem($pid){ - return get_creator_from_id($pid)['user_id'] == $_SESSION['user']['user_id']; + $owns = get_creator_from_id($pid)['user_id'] == $_SESSION['user']['user_id']; + if(!$owns) { + die(); + } else { + return $owns; + } } @@ -399,4 +404,4 @@ function get_activity_phrase($activity){ return "failed " . "" . htmlspecialchars(get_problem_from_id(get_pid_by_sid($activity['id']))['problem_name']) .""; } } -} \ No newline at end of file +}