PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.18.0
GiveWP – Donation Plugin and Fundraising Platform v4.18.0
4.18.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 All 257 releases
← All changes | includes/donors/class-give-donor-wall.php +6 -7 4.16.9 → 4.18.0 View file →
@@ -380,8 +380,10 @@
380 380
381 381 /**
382 382 * Get donation data.
383 383 *
384 + * @since 4.18.0 Read meta values as stored instead of unserializing them, and read the donor
385 + * comment from the fetched rows instead of a per-donation meta lookup.
384 386 * @since 4.16.7.2 Restrict unserialize to prevent object instantiation.
385 387 * @since 2.27.0 Change to read comment from donations meta table
386 388 * @since 2.3.0
387 389 *
@@ -416,9 +418,9 @@
416 418 $temp = [];
417 419
418 420 /* @var stdClass $result */
419 421 foreach ( $results as $result ) {
420 - $temp[ $result->{$donation_id_col} ][ $result->meta_key ] = unserialize( $result->meta_value, [ 'allowed_classes' => false ] );
422 + $temp[ $result->{$donation_id_col} ][ $result->meta_key ] = $result->meta_value;
421 423
422 424 // Set donation date.
423 425 if ( empty( $temp[ $result->{$donation_id_col} ]['donation_date'] ) ) {
424 426 $temp[ $result->{$donation_id_col} ]['donation_date'] = $result->donation_date;
@@ -435,16 +437,13 @@
435 437 'lastname' => $donation_data['_give_donor_billing_last_name'],
436 438 ]
437 439 );
438 440
439 - $temp[$donation_id]['donor_comment'] = give_get_payment_meta(
440 - $donation_id,
441 - DonationMetaKeys::COMMENT
442 - );
441 + $temp[ $donation_id ]['donor_comment'] = $donation_data[ DonationMetaKeys::COMMENT ] ?? '';
443 442 }
443 +
444 + $results = ! empty( $temp ) ? $temp : [];
444 445 }
445 -
446 - $results = ! empty( $temp ) ? $temp : [];
447 446 }
448 447
449 448 return $results;
450 449 }