Skip to content

Commit

Permalink
Check PayPal post var is not empty before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
clavaque committed Dec 3, 2020
1 parent 746dd68 commit 2c2889a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/includes/classes/paypal-utilities.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ public static function paypal_postvars()
{
foreach(preg_split("/[\r\n]+/", preg_replace("/^SUCCESS/i", "", $response)) as $varline)
{
list($key, $value) = preg_split("/\=/", $varline, 2);
if(strlen($key = trim($key)) && strlen($value = trim($value)))
$postvars[$key] = trim(stripslashes(urldecode($value)));
if (!empty($varline)) {
list($key, $value) = preg_split("/\=/", $varline, 2);
if (strlen($key = trim($key)) && strlen($value = trim($value)))
$postvars[$key] = trim(stripslashes(urldecode($value)));
}
}
$postvars = self::paypal_postvars_back_compat($postvars); // From verified data.

Expand Down

0 comments on commit 2c2889a

Please sign in to comment.