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/component/class-recipient-verification.php +10 -5 6.0.1 → 6.3.0 View file →
@@ -42,9 +42,9 @@
42 42 $recipient_id = trim( (string) ( $data['id'] ?? '' ) );
43 43 $raw_pending = $data['pending'] ?? null;
44 44 $statuses = array_map( 'sanitize_key', is_array( $raw_pending ) ? $raw_pending : array() );
45 45
46 - if ( '' === $recipient_id || empty( $statuses ) ) {
46 + if ( '' === $recipient_id || array() === $statuses ) {
47 47 return $this->response_data( false, esc_html__( 'Invalid request.', 'defender-security' ) );
48 48 }
49 49
50 50 $in_house = is_numeric( $recipient_id );
@@ -58,9 +58,9 @@
58 58 if ( null === $subscriber ) {
59 59 return $this->response_data( false, esc_html__( 'Recipient not found.', 'defender-security' ) );
60 60 }
61 61
62 - if ( empty( $modules ) ) {
62 + if ( ! is_array( $modules ) || array() === $modules ) {
63 63 return $this->response_data( false, esc_html__( 'Module not found.', 'defender-security' ) );
64 64 }
65 65
66 66 return $this->send_verification_email( $subscriber, $modules );
@@ -74,9 +74,9 @@
74 74 * @return array Sanitized slug list.
75 75 */
76 76 public function parse_subscription_slugs( $slug, $uids ): array {
77 77 if ( is_string( $uids ) && '' !== trim( $uids ) ) {
78 - return array_filter( array_map( 'sanitize_key', explode( ',', $uids ) ) );
78 + return array_filter( array_map( 'sanitize_key', explode( ',', $uids ) ), fn( string $v ): bool => '' !== $v );
79 79 }
80 80 if ( is_string( $slug ) && '' !== trim( $slug ) ) {
81 81 return array( sanitize_key( $slug ) );
82 82 }
@@ -103,14 +103,19 @@
103 103 continue;
104 104 }
105 105 $result['found_module'] = true;
106 106
107 - $match = $this->confirm_recipients_in_group( $model->$group, $hash, $group );
107 + $recipients = 'in_house_recipients' === $group ? $model->in_house_recipients : $model->out_house_recipients;
108 + $match = $this->confirm_recipients_in_group( $recipients, $hash, $group );
108 109 if ( null === $match ) {
109 110 continue;
110 111 }
111 112
112 - $model->$group = $match['recipients'];
113 + if ( 'in_house_recipients' === $group ) {
114 + $model->in_house_recipients = $match['recipients'];
115 + } else {
116 + $model->out_house_recipients = $match['recipients'];
117 + }
113 118 $model->save();
114 119
115 120 $result['processed'] = true;
116 121 $result['redirect_slug'] = '' === $result['redirect_slug'] ? $model->slug : $result['redirect_slug'];