Advertisement:

Author Topic: Paid subscription (Script or Paypal forgets the + ) temp fix included  (Read 3222 times)

Offline telcy

  • Semi-Newbie
  • *
  • Posts: 13
Hi,

We have a simple machines board with many daily subscriptions.
Sometimes the script or paypal forgets the "+" in the item_number.

So the script can't recover the member id.

The right one: 3+32472
If the script gets a wrong one: 3 32472

I can't say exactly where this problem starts, but I've added a temp fix which replaces the white space with a + letter.

Subscriptions-Paypal.php

AFTER:
Code: [Select]
// Check that this is intended for us.
if ($modSettings['paypal_email'] != $_POST['business'] && (empty($modSettings['paypal_additional_emails']) || !in_array($_POST['business'], explode(',', $modSettings['paypal_additional_emails']))))
exit;

INSERT:
Code: [Select]
// Temp fix: Replace white space with plus
$_POST['item_number'] = str_replace(" ", "+", $_POST['item_number']);



Regards,
telcy

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,610
    • StoryBB/StoryBB on GitHub
Re: Paid subscription (Script or Paypal forgets the + ) temp fix included
« Reply #1 on: January 19, 2014, 01:18:15 PM »
Included in 2.1, thanks, though done under a slightly different format and in a way that would not affect the intended behaviour of everything (and wouldn't throw errors if not sent)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.