The problem that prompted this issue:
A customer's EDD debug log is being written to the file. However, when trying to view it in EDD, the debug log is blank.
The likely culprit:
When we are logging the IPN response from Paypal, paypal sends it using "windows-1252" as the charset. This seems to be causing it to fail the esc_textarea function because there are special characters in the paypal IPN response if a person's name has special characters.
See the special character on line 1528:

A possible solution:
I spoke with @cklosowski and he mentioned a possible solution might be to convert the carset of each array item to utf-8.
Apparently this is something you can change in your PayPal settings:
https://www.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-language-encoding
You can click 'More Options' and set UTF-8 as your encoding for all requests.
going to punt for now, since there is a work around @mintplugins. I want to be able to do some extensive testing on this before it goes live and I need to try and get 2.9.4 moving along.
I have a proposed PR here, we just need somewhere to replicate it and verify that the conversion works.
I've replicated and I _think_ can confirm that it's fixed. 😣
To replicate:
http://testsite.co/?edd-listener=IPN, I used Cart Checkout as my Transaction Type, and down in the first_name field, adjust it from John to Johnö. Notice that extra ö character on the name... that's what we'll be tracking./wp-content/uploads/123blah123-edd-debug.log and open it up. For the simulated payment you sent with the IPN simulator, you should see all instances of the first_name key with a value of John�. The fact that EDD's Debug Log displays blank while the actual log has data is replicating the issue.
To test issue6243:
issue/6243.� character is still present and I guess that's what breaks the display.first_name key with a value of John?I believe the fact that EDD's Debug Log now properly displays the log entries is what this issue set out to fix. However, I do not know if the character changing from � to ? is exactly what was desired.
If so, :+1:
Bug and fix both check out, merged!
This has triggered a fatal error on one of my local hosts:
Fatal error: Uncaught Error: Call to undefined function mb_convert_encoding() in /var/www/html/wp/wp-content/plugins/easy-digital-downloads/includes/class-edd-logging.php:528
We need to account for that safely.
Additional PR submitted.
@pippinsplugins Tested. Everything still works, as expected. :+1:
Any idea how that caused a fatal? I'm sure you're not running PHP 3 lol.
No clue. I'm running PHP 7.2 locally . . .
Usually it means you haven't installed the php_mbstring package (which is commonly installed, but not part of a default LAMP install)
mbstring being` MultiByte Strings