PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.5.6.3
JetFormBuilder — Dynamic Blocks Form Builder v3.5.6.3
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / modules / validation / handlers / ajax-validation-handler.php
jetformbuilder / modules / validation / handlers Last commit date
ajax-validation-handler.php 1 year ago self-validation-handler.php 1 year ago validation-handler.php 4 months ago
ajax-validation-handler.php
38 lines
1 <?php
2 namespace JFB_Modules\Validation\Handlers;
3
4 use JFB_Modules\Validation\Handlers\Validation_Handler;
5
6 // If this file is called directly, abort.
7 if ( ! defined( 'WPINC' ) ) {
8 die;
9 }
10
11 class Ajax_Validation_Handler {
12 public function __construct() {
13 add_action( 'wp_ajax_jet_fb_ssr_validation_ajax', array( $this, 'jet_fb_ssr_validation_ajax' ) );
14 add_action( 'wp_ajax_nopriv_jet_fb_ssr_validation_ajax', array( $this, 'jet_fb_ssr_validation_ajax' ) );
15 }
16 public function jet_fb_ssr_validation_ajax() {
17 // phpcs:ignore WordPress.Security.NonceVerification.Missing
18 if ( ! isset( $_POST['data'] ) ) {
19 wp_send_json_error( array( 'message' => 'No data provided' ) );
20 }
21
22 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.NonceVerification.Missing
23 $body = json_decode( stripslashes( $_POST['data'] ), true );
24
25 foreach ( $body as $key => $value ) {
26 if ( strpos( $key, '[]' ) !== false ) {
27 unset( $body[ $key ] );
28 $new_key = str_replace( '[]', '', $key );
29 $body[ $new_key ] = is_array( $value ) ? $value : array( $value );
30 }
31 }
32
33 $result = Validation_Handler::validate( $body );
34
35 wp_send_json( $result );
36 }
37 }
38