PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.3.0
Defender Security – Malware Scanner, Login Security & Firewall v6.3.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
← All changes | src/controller/class-recipients.php +23 -1 6.1.0 → 6.3.0 View file →
@@ -108,9 +108,31 @@
108 108 if ( ! $in_house && ! preg_match( '/^[\p{L}\s\-\']+$/u', $name ) ) {
109 109 return new Response( false, array( 'message' => esc_html__( 'Only letters, spaces, hyphens and apostrophes allowed.', 'defender-security' ) ) );
110 110 }
111 111
112 - if ( empty( $statuses ) ) {
112 + // Block duplicate recipient emails. Messages render as React text, so keep them unescaped.
113 + if ( $this->recipient_directory->email_exists( $email ) ) {
114 + return new Response(
115 + false,
116 + array(
117 + 'message' => __( 'This email address is already added as a recipient. Edit the existing recipient to add more report types.', 'defender-security' ),
118 + 'code' => 'recipient_notice',
119 + )
120 + );
121 + }
122 +
123 + // Registered users must be added via user search, not invited by email.
124 + if ( ! $in_house && get_user_by( 'email', $email ) ) {
125 + return new Response(
126 + false,
127 + array(
128 + 'message' => __( "Registered user email can't be invited, you can add them directly at Search WordPress user tab.", 'defender-security' ),
129 + 'code' => 'recipient_notice',
130 + )
131 + );
132 + }
133 +
134 + if ( array() === $statuses ) {
113 135 return new Response( false, array( 'message' => esc_html__( 'Please enable at least one notification module before inviting a recipient.', 'defender-security' ) ) );
114 136 }
115 137
116 138 $subscriber = array(