Skip to content

Commit 2c2889a

Browse files
committed
Check PayPal post var is not empty before using it
1 parent 746dd68 commit 2c2889a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/includes/classes/paypal-utilities.inc.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ public static function paypal_postvars()
6161
{
6262
foreach(preg_split("/[\r\n]+/", preg_replace("/^SUCCESS/i", "", $response)) as $varline)
6363
{
64-
list($key, $value) = preg_split("/\=/", $varline, 2);
65-
if(strlen($key = trim($key)) && strlen($value = trim($value)))
66-
$postvars[$key] = trim(stripslashes(urldecode($value)));
64+
if (!empty($varline)) {
65+
list($key, $value) = preg_split("/\=/", $varline, 2);
66+
if (strlen($key = trim($key)) && strlen($value = trim($value)))
67+
$postvars[$key] = trim(stripslashes(urldecode($value)));
68+
}
6769
}
6870
$postvars = self::paypal_postvars_back_compat($postvars); // From verified data.
6971

0 commit comments

Comments
 (0)