Closed antoshk closed 8 years ago
Thanks for your report!
Definitely would need to use map_deep
there.
IIRC this is already fixed in the feature branch, which will be released soon.
After merging #49 this shouldn't be a problem anymore. Now uses array_walk_recursive( $data, 'sanitize_text_field' )
. The message, which is a multi-line string from a textarea, is treated separately using array_map()
.
I always receive feedback email with corrupted fields "Name", "Email" and "Browser":
I tried to dig in code and found that this data is sending as small arrays in big array of all other data. When WordPress receives this big array it passes though sanitize_text_field() function using array_map() function:
$data = array_map( 'sanitize_text_field', $_POST['data'] );
sanitize_text_field() receives as argument the array of user and browser data strings instead of just string and it corrupts this data.