Rest update bug
-
Hello in ‘includes\contact-form-functions.php’ is this function:
function wpcf7_sanitize_mail( $input, $defaults = array() ) { $input = wp_parse_args( $input, array( 'active' => false, 'subject' => '', 'sender' => '', 'recipient' => '', 'body' => '', 'additional_headers' => '', 'attachments' => '', 'use_html' => false, 'exclude_blank' => false, ) ); $input = wp_parse_args( $input, $defaults );wich ignores the ‘$defaults” parameter, because the first ‘wp_parse_args()’ already sets empty default values for $input.
the second time $input is assigned with wp_parse_args() nothing is set.previus old version of the code works correctly:
http://hookr.io/plugins/contact-form-7/4.7/functions/wpcf7_sanitize_mail/
– first wp_parse_args() $defaults, and second the $input.because of this the rest function wpcf7_rest_update_contact_form() in ‘includes/rest-api.php’ doesn’t work correctly, if we dont send the mail property this will be update empty either with post or patch.
thanks.
The topic ‘Rest update bug’ is closed to new replies.