Changeset 1444837
- Timestamp:
- 06/28/2016 09:36:50 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
email-domain-verification-in-cf7/trunk/contact-form-7-email-validation-check.php
r1365472 r1444837 21 21 22 22 function wpcf7_email_validation_has_parent_plugin() { 23 if (is_admin() && current_user_can( 'activate_plugins') && !is_plugin_active('contact-form-7/wp-contact-form-7.php')) {23 if (is_admin() && current_user_can("activate_plugins") && !is_plugin_active("contact-form-7/wp-contact-form-7.php")) { 24 24 add_action('admin_notices', 'wpcf7_email_validation_nocf7_notice'); 25 25 … … 51 51 } 52 52 53 function wpcf7_validate_email_check($email ) {53 function wpcf7_validate_email_check($emailAddress) { 54 54 55 $exp = "^[a-z\'0-9]+([._-][a-z\'0-9]+)*@([a-z0-9]+([._-][a-z0-9]+))+$";55 $expression = "^[a-z\'0-9]+([._-][a-z\'0-9]+)*@([a-z0-9]+([._-][a-z0-9]+))+$"; 56 56 57 if (eregi($exp , $email)) {58 if (checkdnsrr(array_pop(explode("@", $email )), "MX")) {57 if (eregi($expression, $emailAddress)) { 58 if (checkdnsrr(array_pop(explode("@", $emailAddress)), "MX")) { 59 59 return true; 60 60 } else { … … 66 66 } 67 67 68 function wpcf7_custom_email_validation_filter($result, $tag ) {68 function wpcf7_custom_email_validation_filter($result, $tags) { 69 69 70 $tag = new WPCF7_Shortcode( $tag);70 $tags = new WPCF7_Shortcode( $tags ); 71 71 + 72 $type = $tag ->type;73 $name = $tag ->name;72 $type = $tags->type; 73 $name = $tags->name; 74 74 75 75 if ('email' == $type || 'email*' == $type) { // Only apply to fields with the form field name of "company-email" … … 78 78 79 79 if(!wpcf7_validate_email_check($email_value)){ 80 $result->invalidate( $tag , "Email address entered is invalid, DNS resolution failed.");80 $result->invalidate( $tags, "Email address entered is not valid, DNS resolution failed."); 81 81 } 82 82 }
Note: See TracChangeset
for help on using the changeset viewer.