mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-04-29 18:59:21 +02:00
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:
parent
2c050dae1b
commit
5e67cf7450
@ -36,6 +36,11 @@ if ($view !== false){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ticketData = mysql_select_single("SELECT * FROM znote_tickets WHERE id='$view' LIMIT 1;");
|
$ticketData = mysql_select_single("SELECT * FROM znote_tickets WHERE id='$view' LIMIT 1;");
|
||||||
|
if(!$ticketData) {
|
||||||
|
echo 'You can not view this ticket!';
|
||||||
|
include 'layout/overall/footer.php';
|
||||||
|
die;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<h1>View Ticket #<?php echo $ticketData['id']; ?></h1>
|
<h1>View Ticket #<?php echo $ticketData['id']; ?></h1>
|
||||||
<table class="znoteTable ThreadTable table table-striped">
|
<table class="znoteTable ThreadTable table table-striped">
|
||||||
@ -144,4 +149,4 @@ if ($view !== false){
|
|||||||
} else echo 'No helpdesk tickets has been submitted.';
|
} else echo 'No helpdesk tickets has been submitted.';
|
||||||
}
|
}
|
||||||
include 'layout/overall/footer.php';
|
include 'layout/overall/footer.php';
|
||||||
?>
|
?>
|
||||||
|
@ -21,7 +21,7 @@ if ($view !== false) {
|
|||||||
}
|
}
|
||||||
$ticketData = mysql_select_single("SELECT * FROM znote_tickets WHERE id='$view' LIMIT 1;");
|
$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!';
|
echo 'You can not view this ticket!';
|
||||||
include 'layout/overall/footer.php';
|
include 'layout/overall/footer.php';
|
||||||
die;
|
die;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user