Skip to content

Commit cc2e10a

Browse files
author
Mukesh Kumar
authored
Update class-contact-form.php
1 parent e370d70 commit cc2e10a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/contact-form/class-contact-form.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,13 +2451,13 @@ public function process_file_upload_field( $field_id, $field ) {
24512451

24522452
$raw_data = array();
24532453
// phpcs:ignore WordPress.Security.NonceVerification.Missing
2454-
if ( isset( $_POST[ $field_id ] ) ) {
2455-
2456-
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing
2457-
$raw_post_data = wp_unslash( $_POST[ $field_id ] );
2458-
if ( is_array( $raw_post_data ) ) {
2459-
$raw_data = array_map( 'sanitize_text_field', $raw_post_data );
2460-
}
2454+
if ( isset( $_POST[ $field_id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
2455+
$raw = wp_unslash( $_POST[ $field_id ] );
2456+
if ( is_array( $raw ) ) {
2457+
return array_map( 'sanitize_textarea_field', $raw );
2458+
} else {
2459+
return sanitize_textarea_field( (string) $raw );
2460+
}
24612461
}
24622462

24632463
$file_data_array = is_array( $raw_data )

0 commit comments

Comments
 (0)