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/API/REST/V3/Routes/Donors/DonorController.php +9 -0 4.16.7 → 4.17.0 View file →
@@ -188,8 +188,9 @@
188 188
189 189 /**
190 190 * Update a single donor.
191 191 *
192 + * @since 4.17.0 Non-admin callers may no longer add unverified email addresses.
192 193 * @since 4.16.6 Skip readonly schema properties when applying PATCH updates.
193 194 * @since 4.8.0 Update donor name when firstName or lastName is updated
194 195 * @since 4.7.0 Add support for updating custom fields
195 196 * @since 4.4.0
@@ -218,8 +219,16 @@
218 219 }
219 220 )
220 221 )
221 222 );
223 +
224 + if (!DonorPermissions::canEdit() && $request->has_param('additionalEmails')) {
225 + $allowed = array_merge($donor->additionalEmails ?? [], [$donor->email]);
226 + $request->set_param(
227 + 'additionalEmails',
228 + array_values(array_intersect((array)$request->get_param('additionalEmails'), $allowed))
229 + );
230 + }
222 231
223 232 foreach ($request->get_params() as $key => $value) {
224 233 if (! in_array($key, $nonEditableFields, true)) {
225 234 if ($donor->hasProperty($key)) {