Paypal IPN error with embedded newline in the address

So this is new to me. My Paypal IP address has been working for a while and started receiving an error message today.

During the postback to check with PayPal (adding cmd = _notify-validate), the PayPal responder says, "No, that wasn’t from me." The only thing strangely related to this particular entry is (I believe) the way the user entered his address:

123 Street Address
 # 789

Everything else seems normal, and the IPN handler handles the other notifications quite happily.

Has anyone seen anything like this?

+5
source share
2 answers

, , , ​​.

:

foreach ($post_array as $name => $value) {
  $value = urlencode($value);
  $post_string .= $name . '=' . $value . '&';
}
$post_string .= "cmd=_notify-validate";

/n /r/n, :

foreach ($post_array as $name => $value) {
  $value = urlencode(str_replace("\n", "\r\n", $value));
  $post_string .= $name . '=' . $value . '&';
}
$post_string .= "cmd=_notify-validate";

PayPal .

.

+4

, .

, -, , CodeIgniter, , CodeIgniter https://github.com/EllisLab/CodeIgniter/blob/2.1.4/system/core/Input.php#L707

, , IPN, - .

$value = urlencode(str_replace("\n", "\r\n", $value));
0

All Articles