PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.16
Yatra – Travel Booking & Tour Operator Software v3.0.16
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
← All changes | app/Controllers/EnquiryController.php +21 -0 3.0.9 → 3.0.16 View file →
@@ -204,8 +204,21 @@
204 204 if (empty($data)) {
205 205 $data = $request->get_params();
206 206 }
207 207
208 + // reCAPTCHA v3 (no-op unless the enquiry form is protected in settings).
209 + $recaptcha = \Yatra\Services\RecaptchaService::verifyForm(
210 + 'enquiry',
211 + (string) ($data['recaptcha_token'] ?? ''),
212 + $_SERVER['REMOTE_ADDR'] ?? null
213 + );
214 + if (empty($recaptcha['success'])) {
215 + return new WP_REST_Response([
216 + 'success' => false,
217 + 'message' => $recaptcha['message'] ?? __('reCAPTCHA verification failed.', 'yatra'),
218 + ], 400);
219 + }
220 +
208 221 $result = $this->enquiryService->createEnquiry($data);
209 222
210 223 if (!$result['success']) {
211 224 return new WP_REST_Response($result, 400);
@@ -273,8 +286,16 @@
273 286 break;
274 287
275 288 case 'mark_pending':
276 289 $result = $this->enquiryService->bulkUpdateStatus($ids, 'pending');
290 + break;
291 +
292 + case 'mark_completed':
293 + $result = $this->enquiryService->bulkUpdateStatus($ids, 'completed');
294 + break;
295 +
296 + case 'mark_closed':
297 + $result = $this->enquiryService->bulkUpdateStatus($ids, 'closed');
277 298 break;
278 299
279 300 case 'mark_spam':
280 301 $result = $this->enquiryService->bulkUpdateStatus($ids, 'spam');