strangerstudios / pmpro-donations

Allow customers to set an additional donation amount at checkout with Paid Memberships Pro.
https://www.paidmembershipspro.com/add-ons/donations-add-on/
8 stars 17 forks source link

Add delimiters to regular expressions in checkout.php #47

Closed becleung closed 1 year ago

becleung commented 1 year ago

preg_replace( '[^0-9\.]', '', $_REQUEST['donation'] );

and

preg_replace( '[^0-9\.]', '', $_REQUEST['donation'] );

doesn't do anything anymore. It might have something to do with upgrading to PHP8.

When something like "US$9" is entered into the donation field, it passes right through unchanged.

Adding delimiters gets it working again.

dparker1005 commented 1 year ago

Resolves #40