| @@ -33,9 +33,9 @@ | ||
| 33 | 33 | public function get_sender_name( $notification_slug ): string { |
| 34 | 34 | $whitelabel = new Dashboard_Whitelabel(); |
| 35 | 35 | if ( $whitelabel->can_whitelabel() ) { |
| 36 | 36 | $plugin_label = $whitelabel->get_plugin_name( Config_Hub_Helper::WDP_ID ); |
| 37 | - if ( empty( $plugin_label ) ) { | |
| 37 | + if ( false === $plugin_label || '' === $plugin_label ) { | |
| 38 | 38 | $plugin_label = $this->find_feature_name_by_slug( $notification_slug ); |
| 39 | 39 | } |
| 40 | 40 | } else { |
| 41 | 41 | $plugin_label = esc_html__( 'Defender', 'defender-security' ); |
| @@ -88,8 +88,10 @@ | ||
| 88 | 88 | * @return array An array of headers for the email. |
| 89 | 89 | */ |
| 90 | 90 | public function get_headers( $from_email, $notification_slug = '' ): array { |
| 91 | 91 | $from_label = $this->get_sender_name( $notification_slug ); |
| 92 | + $from_email = str_replace( array( "\r", "\n" ), '', $from_email ); | |
| 93 | + $from_label = str_replace( array( "\r", "\n" ), '', $from_label ); | |
| 92 | 94 | $headers = array( |
| 93 | 95 | 'From: ' . $from_label . ' <' . $from_email . '>', |
| 94 | 96 | 'Content-Type: text/html; charset=UTF-8', |
| 95 | 97 | ); |