Fix error in helpdesk.php (#516)

Error: Warning: Trying to access array offset on value of type bool in C:....\helpdesk.php on line 34
If I put a non-existent ID in the URL, it throws the error.
This commit is contained in:
Luan Luciano
2022-07-10 05:07:37 -03:00
committed by GitHub
parent 2c050dae1b
commit 5e67cf7450
2 changed files with 7 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ if ($view !== false) {
}
$ticketData = mysql_select_single("SELECT * FROM znote_tickets WHERE id='$view' LIMIT 1;");
if($ticketData['owner'] != $session_user_id) {
if(!$ticketData || $ticketData['owner'] != $session_user_id) {
echo 'You can not view this ticket!';
include 'layout/overall/footer.php';
die;