PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
1.8.13.1 1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 All 212 releases
← All changes | includes/users/class-charitable-user.php +13 -2 1.8.11.1 → 1.8.13 View file →
@@ -855,10 +855,21 @@
855 855 } else {
856 856 $donor_id = $this->get_donor_id();
857 857 }
858 858
859 - /* Clear out the cache */
860 - wp_cache_delete( $donor_id, 'donors' );
859 + /*
860 + * Clear out the cache.
861 + *
862 + * Only when there is actually an ID. get_donor_id() returns false for a donor who does not
863 + * exist yet, which is the normal path into the insert() below - and the `if ( $donor_id )`
864 + * immediately after this already accounts for that. Passing false as a cache key trips
865 + * WP 6.1+'s "Cache key must be an integer or a non-empty string" _doing_it_wrong notice on
866 + * every new-donor save. Deleting the key false was a no-op regardless, so guarding it
867 + * changes no behaviour.
868 + */
869 + if ( $donor_id ) {
870 + wp_cache_delete( $donor_id, 'donors' );
871 + }
861 872
862 873 if ( $donor_id ) {
863 874 charitable_get_table( 'donors' )->update( $donor_id, $donor_data );
864 875