PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.17.0
GiveWP – Donation Plugin and Fundraising Platform v4.17.0
4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 All 256 releases
← All changes | src/DonorDashboards/Profile.php +4 -1 4.16.3 → 4.17.0 View file →
@@ -33,8 +33,9 @@
33 33
34 34 /**
35 35 * Handles updating relevant profile fields in donor database and meta database
36 36 *
37 + * @since 4.17.0 Logged-in donors can no longer add unverified email addresses.
37 38 * @since 2.27.3 Use Donor model to update data used by webhooks addon to prevent multiple events creation
38 39 * @since 2.10.0
39 40 *
40 41 * @param object $data Object representing profile data to update
@@ -46,10 +47,12 @@
46 47 public function update($data)
47 48 {
48 49 $donor = Donor::find($this->donor->id);
49 50
51 + $allowed = array_merge($donor->additionalEmails ?? [], [$donor->email]);
52 + $donor->additionalEmails = array_values(array_intersect($data['additionalEmails'] ?: [], $allowed));
53 +
50 54 $donor->email = $data['primaryEmail'];
51 - $donor->additionalEmails = $data['additionalEmails'] ?: [];
52 55
53 56 if ( ! empty($data['firstName']) && ! empty($data['lastName'])) {
54 57 $firstName = $data['firstName'];
55 58 $lastName = $data['lastName'];