<commit_before><?php
define('IN_SCRIPT', 1);
define('HESK_PATH', '../../');
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');

hesk_load_api_database_functions();
hesk_dbConnect();

// Routing
if (isset($_GET['id'])) {
    $response = hesk_dbQuery("SELECT `id`, `message`, `html`, `title`, `reply_order` FROM `"
        . hesk_dbEscape($hesk_settings['db_pfix']) . "std_replies` WHERE `id` = ".intval($_GET['id']));
    $result = hesk_dbFetchAssoc($response);

    header('Content-Type: application/json');
    print json_encode($result);
    return http_response_code(200);
}<commit_msg>#407 Add endpoint for canned responses<commit_after><?php
define('IN_SCRIPT', 1);
define('HESK_PATH', '../../');
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');

hesk_load_api_database_functions();
hesk_dbConnect();

// Routing
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']));
    $result = hesk_dbFetchAssoc($response);
    $result['message'] = html_entity_decode($result['message']);

    header('Content-Type: application/json');
    print json_encode($result);
    return http_response_code(200);
}
{'fraction_non_alphanumeric': 0.19910179640718562, 'fraction_numerical': 0.008233532934131737, 'mean_word_length': 5.553921568627451, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '310900', 'n_tokens_mistral': 477, 'n_tokens_neox': 474, 'n_words': 74}