diff --git a/api/canned/index.php b/api/canned/index.php index 996f6274..cd0b5387 100644 --- a/api/canned/index.php +++ b/api/canned/index.php @@ -11,8 +11,12 @@ hesk_dbConnect(); if (isset($_GET['id'])) { $response = hesk_dbQuery("SELECT `id`, `message`, `title`, `reply_order` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "std_replies` WHERE `id` = ".intval($_GET['id'])); + if (hesk_dbNumRows($response) == 0) { + return http_response_code(404); + } $result = hesk_dbFetchAssoc($response); - $result['message'] = html_entity_decode($result['message']); + $result['title'] = hesk_html_entity_decode($result['title']); + $result['message'] = hesk_html_entity_decode($result['message']); header('Content-Type: application/json'); print json_encode($result); diff --git a/api/ticket-templates/index.php b/api/ticket-templates/index.php new file mode 100644 index 00000000..c2e02b79 --- /dev/null +++ b/api/ticket-templates/index.php @@ -0,0 +1,24 @@ +