Hi @takayukister
I was debbuging this issue and I think I found an easy solution. I know this is not critical, but this could be the fix for full Domain Mapping compatibility.
I just made some changes to this function:
(/contact-form-7/includes/formatting.php)
function wpcf7_is_email_in_site_domain( $email ) {
if ( wpcf7_is_localhost() ) {
return true;
}
$site_domain = strtolower( $_SERVER['SERVER_NAME'] );
if ( preg_match( '/^[0-9.]+$/', $site_domain ) ) { // 123.456.789.012
return true;
}
if ( wpcf7_is_email_in_domain( $email, $site_domain ) ) {
return true;
}
$site_url = home_url();
if ( is_multisite() && function_exists( 'domain_mapping_siteurl' ) ) {
$site_url = domain_mapping_siteurl( false );
}
if ( preg_match( '%^https?://([^/]+)%', $site_url, $matches ) ) {
$site_domain = strtolower( $matches[1] );
if ( $site_domain != strtolower( $_SERVER['SERVER_NAME'] )
&& wpcf7_is_email_in_domain( $email, $site_domain ) ) {
return true;
}
}
return false;
}
What do you think about this solution?
Is it possible to be included as an enhacement in the next release?
Regards.