Skip to content

Commit

Permalink
Enhancement: use give_maybe_safe_unserialize for user data (#7533)
Browse files Browse the repository at this point in the history
Co-authored-by: Jon Waldstein <[email protected]>
  • Loading branch information
glaubersilva and jonwaldstein authored Sep 6, 2024
1 parent 5fbfa63 commit 4f6d503
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion includes/process-donation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* Handles the donation form process.
*
* @access private
* @unreleased Use give_maybe_safe_unserialize() on $user_info data
* @since 1.0
*
* @throws ReflectionException Exception Handling.
Expand Down Expand Up @@ -151,12 +152,13 @@ function give_process_donation_form() {
);

// Setup donation information.
$user_info = array_map('give_maybe_safe_unserialize', stripslashes_deep( $user_info ));
$donation_data = [
'price' => $price,
'purchase_key' => $purchase_key,
'user_email' => $user['user_email'],
'date' => date( 'Y-m-d H:i:s', current_time( 'timestamp' ) ),
'user_info' => stripslashes_deep( $user_info ),
'user_info' => $user_info,
'post_data' => $post_data,
'gateway' => $valid_data['gateway'],
'card_info' => $valid_data['cc_info'],
Expand Down

0 comments on commit 4f6d503

Please sign in to comment.