Skip to content

Commit

Permalink
Adjust bad SQL query that allowed contacts to see ticket subjects (bu…
Browse files Browse the repository at this point in the history
…t not content) for other contacts
  • Loading branch information
wrongecho committed Apr 1, 2024
1 parent da2fee7 commit 2f473c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions portal/ticket_view_all.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
if (!isset($_GET['status'])) {
// If nothing is set, assume we only want to see open tickets
$status = 'Open';
$ticket_status_snippet = "ticket_status != 5";
$ticket_status_snippet = "ticket_closed_at IS NULL";
} elseif (isset($_GET['status']) && ($_GET['status']) == 'Closed') {
$status = 'Closed';
$ticket_status_snippet = "ticket_status = 5";
$ticket_status_snippet = "ticket_closed_at IS NOT NULL";
} else {
$status = '%';
$ticket_status_snippet = "ticket_status LIKE '%'";
Expand Down
4 changes: 2 additions & 2 deletions portal/tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
if (!isset($_GET['status'])) {
// If nothing is set, assume we only want to see open tickets
$status = 'Open';
$ticket_status_snippet = "ticket_status != 5 AND ticket_status != 'Closed'";
$ticket_status_snippet = "ticket_closed_at IS NULL";
} elseif (isset($_GET['status']) && ($_GET['status']) == 'Closed') {
$status = 'Closed';
$ticket_status_snippet = "ticket_status = 5 OR ticket_status = 'Closed'";
$ticket_status_snippet = "ticket_closed_at IS NOT NULL";
} else {
$status = '%';
$ticket_status_snippet = "ticket_status LIKE '%'";
Expand Down

0 comments on commit 2f473c6

Please sign in to comment.