| @@ -43,8 +43,14 @@ | ||
| 43 | 43 | global /* For Multisite support. */ $current_site, $current_blog; |
| 44 | 44 | |
| 45 | 45 | do_action("ws_plugin__s2member_before_paypal_return", get_defined_vars ()); |
| 46 | 46 | |
| 47 | + //260831.0135 Normalize optional s2Member proxy fields once; direct PayPal returns omit them, while proxied gateway integrations provide strings. | |
| 48 | + if(!isset($_GET["s2member_paypal_proxy"]) || !is_string($_GET["s2member_paypal_proxy"])) | |
| 49 | + $_GET["s2member_paypal_proxy"] = ""; | |
| 50 | + if(!isset($_GET["s2member_paypal_proxy_use"]) || !is_string($_GET["s2member_paypal_proxy_use"])) | |
| 51 | + $_GET["s2member_paypal_proxy_use"] = ""; | |
| 52 | + | |
| 47 | 53 | if (!empty($_GET["s2member_paypal_return"]) && ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"] || !empty($_GET["s2member_paypal_proxy"]))) |
| 48 | 54 | { |
| 49 | 55 | $paypal = array(); // Initialize PayPal array; we also reference this with a variable for a possible proxy handler. |
| 50 | 56 | if(!empty($_GET["s2member_paypal_proxy"]) && in_array($_GET["s2member_paypal_proxy"], array("alipay", "stripe", "authnet", "clickbank", "ccbill", "google"), TRUE)) |
| @@ -75,9 +81,9 @@ | ||
| 75 | 81 | |
| 76 | 82 | if (is_array($paypal = c_ws_plugin__s2member_paypal_utilities::paypal_postvars ()) && ($_paypal = $paypal) && ($_paypal_s = serialize ($_paypal))) |
| 77 | 83 | { |
| 78 | 84 | $paypal["s2member_log"][] = "Return-Data received on: " . date ("D M j, Y g:i:s a T"); |
| 79 | - $paypal["s2member_log"][] = "s2Member POST vars verified " . ((!empty($paypal["proxy_verified"])) ? "with a Proxy Key" : "through a POST back to PayPal."); | |
| 85 | + $paypal["s2member_log"][] = "s2Member POST vars verified " . ((!empty($paypal["proxy_verified"])) ? "through a trusted proxy verification method." : "through a POST back to PayPal."); | |
| 80 | 86 | |
| 81 | 87 | $paypal["subscr_gateway"] = (!empty($_GET["s2member_paypal_proxy"])) ? esc_html (trim (stripslashes ($_GET["s2member_paypal_proxy"]))) : "paypal"; |
| 82 | 88 | |
| 83 | 89 | if (empty($_GET["s2member_paypal_proxy"]) || empty($_GET["s2member_paypal_proxy_use"]) || !preg_match ("/ty-email/", $_GET["s2member_paypal_proxy_use"])) |