PluginProbe
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification / 3.0.62
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification v3.0.62
5.6.2 5.6.3 5.6.1 5.6.0 5.5.0 5.4.0 5.3.2 5.3.1 5.1.6 5.1.5 trunk 2.1.5 2.11 2.12 2.13 2.15 3.0.0 3.0.1 3.0.2 3.0.3 3.0.5 3.0.51 3.0.60 3.0.61 3.0.62 All 38 releases
double-opt-in / core / SanitizeHelper.class.php

SanitizeHelper.class.php in Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification 3.0.62, at core/SanitizeHelper.class.php

39 lines 902 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace forge12\contactform7\CF7DoubleOptIn;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit;
7 }
8
9 class SanitizeHelper {
10 /**
11 * Sanitizes an array by sanitizing the keys and values recursively.
12 *
13 * @param array $data The array to be sanitized.
14 *
15 * @return array The sanitized array.
16 */
17 public static function sanitize_array( $data ): array {
18 if ( ! is_array( $data ) ) {
19 return [];
20 }
21
22 $sanitized_data = [];
23 foreach ( $data as $key => $value ) {
24 if(!apply_filters('f12_cf7_doubleoptin_do_sanitize_key_'.$key, true) || $key === 'body') {
25 $sanitized_data[$key] = $value;
26 continue;
27 }
28
29 if ( is_array( $value ) ) {
30 $sanitized_data[ sanitize_text_field( $key ) ] = self::sanitize_array( $value );
31 } else {
32 $sanitized_data[ sanitize_text_field( $key ) ] = wp_kses_post( $value );
33 }
34 }
35
36 return $sanitized_data;
37 }
38
39 }