← All changes
|
admin/advanced-settings/includes/forms/restricted-email-domains.php
+7
-1
3.9.9
→
4.0.3
View file →
| @@ -1,8 +1,13 @@ | ||
| 1 | 1 | <?php |
| 2 | +// Exit if accessed directly | |
| 3 | +if ( ! defined( 'ABSPATH' ) ) exit; | |
| 2 | 4 | |
| 3 | 5 | function wppb_toolbox_check_email_domain( $message, $field, $request_data, $form_location ) { |
| 4 | 6 | |
| 7 | + if( empty( $request_data['email'] ) ) | |
| 8 | + return $message; | |
| 9 | + | |
| 5 | 10 | $type = wppb_toolbox_get_settings( 'forms', 'restricted-email-domains-type' ); |
| 6 | 11 | |
| 7 | 12 | if ( $type == false ) return $message; |
| 8 | 13 | |
| @@ -9,10 +14,11 @@ | ||
| 9 | 14 | $restricted_domains = wppb_toolbox_get_settings( 'forms', 'restricted-email-domains-data' ); |
| 10 | 15 | |
| 11 | 16 | if ( $restricted_domains == false ) return $message; |
| 12 | 17 | |
| 13 | - $domain = strtolower( substr( strrchr( $request_data['email'], '@' ), 1 ) ); | |
| 18 | + $domain = strtolower( substr( strrchr( trim( $request_data['email'] ), '@' ), 1 ) ); | |
| 14 | 19 | $validation_message = wppb_toolbox_get_settings( 'forms', 'restricted-email-domains-message' ); |
| 20 | + $validation_message = wppb_icl_t( 'plugin profile-builder-pro', 'restricted_email_domains_message_translation', $validation_message, true ); | |
| 15 | 21 | |
| 16 | 22 | if ( $type == 'allow' ) { |
| 17 | 23 | |
| 18 | 24 | if ( !in_array( $domain, $restricted_domains ) ) |