| @@ -15,15 +15,10 @@ | ||
| 15 | 15 | /** |
| 16 | 16 | * Handle Word document upload and processing |
| 17 | 17 | */ |
| 18 | 18 | public function mxchat_handle_word_upload() { |
| 19 | - // Match the PDF handler's nonce verification: the widget sends the chat-send | |
| 20 | - // nonce (action 'mxchat_chat_send'), which the old check_ajax_referer('mxchat_chat_nonce') | |
| 21 | - // rejected with -1. mxchat_verify_chat_send_nonce accepts both chat-send and chat nonces. | |
| 22 | - if (!isset($_POST['nonce']) || !MxChat_Integrator::mxchat_verify_chat_send_nonce(wp_unslash((string) $_POST['nonce']))) { | |
| 23 | - wp_send_json_error(array('message' => esc_html__('Invalid nonce.', 'mxchat')), 403); | |
| 24 | - } | |
| 25 | - | |
| 19 | + check_ajax_referer('mxchat_chat_nonce', 'nonce'); | |
| 20 | + | |
| 26 | 21 | if (!isset($_FILES['word_file']) || !isset($_POST['session_id'])) { |
| 27 | 22 | wp_send_json_error(esc_html__('Missing required parameters.', 'mxchat')); |
| 28 | 23 | return; |
| 29 | 24 | } |