Browse Source

! Additional safely net for paid subs, thanks to telcy

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 10 years ago
parent
commit
19f3cade58
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Sources/Subscriptions-PayPal.php

+ 3 - 0
Sources/Subscriptions-PayPal.php

@@ -256,6 +256,9 @@ class paypal_payment
 			exit;
 
 		// Is this a subscription - and if so is it a secondary payment that we need to process?
+		// If so, make sure we get it in the expected format. Seems PayPal sometimes sends it without urlencoding.
+		if (!empty($_POST['item_number']) && strpos($_POST['item_number'], ' ') !== false)
+			$_POST['item_number'] = str_replace(' ', '+', $_POST['item_number']);
 		if ($this->isSubscription() && (empty($_POST['item_number']) || strpos($_POST['item_number'], '+') === false))
 			// Calculate the subscription it relates to!
 			$this->_findSubscription();