URL for Paypal Donation Destroyed in Text Message Window

The problem is complex and it makes me scratch my head. I am testing a campaign, using an HTML page with a Paypal donation button. It is not a form but an image with the following HREF, which works in the original web page and also the HTML version of the campaign:

https://www.paypal.com/cgi-bin/webscr?business=hbeer@ability1group.eu&cmd=_donations&amount=0&item_name=DEEPclearing&lc=en_US&currency_code=DKK

The text version of the campaign cannot show the button, of course, so I am copying that HREF into the message - but the PHPlist editor changes that line into the following, which Paypal cannot digest:

https://www.paypal.com/cgi-bin/webscr?business=hbeer@ability1group.eu&cmd=_donations&amount=0&item_name=DEEPclearing&lc=en_US¤cy_code=DKK

It does this only with the variable currency_code, not with the other variables contained in the URL.

The only way I could fix this was to go directly to the MySQL database and change the text in the message record (I am talking about a self-hosted version of PHPlist, version 3.3.1) - but after doing that I must completely avoid the editor window, or it will produce the error again.

Is there a setting anywhere that I have to change to avoid this?

Thank you, H.Beer

Not sure, as never used paypal button on a newsletter, but you may need to go to your paypal account and find a text link rather than a paypal image link???

That’s what I did. I first got a text link and manually attached it to an image of my own.

The problem is that the PHPlist editor is changing the URL! And that only in the text message. The HTML message is correctly taken from the web page and is working OK.

Also, the link works instantly when I correct the error directly in the database.

phplist doesn’t edit the plain text content so I am not sure what you mean by this. Are you sending a web page or copying the page contents into phplist, or something else?

Entering the url into a campaign and sending a test email works correctly.

a link
<https://www.paypal.com/cgi-bin/webscr?business=3Dhbeer@ability1group.eu&cm=
d=3D_donations&amount=3D0&item_name=3DDEEPclearing&lc=3Den_US&currency_code=
=3DDKK>

I am copy/pasting the URL into the editor window for the text message of a campaign (2.tab). I then watch as the editor is changing the string “&currency_code=DKK” into the string “¤cy_code=DKK” when I say “save and continue editing”. This is then the value that is written into the database records that are storing the campaign fields.

If I try to overwrite the changed text with the correct text, the editor changes it again upon saving. If I do the same in a separate line only with the string “&currency_code=DKK”, the same thing happens, so it has nothing at all to do with the Paypal link. Other variables, like “&cmd=_donations”, are not being changed.

So it seems that the string “&curren” is translated to a character or symbol outside the alphabet, and I cannot find an editor setting that prevents that!

And the problem seems to be browser independent - I tried it in Chrome, Firefox, Edge and IE - it is the same in all of these browsers.

By the way, the link that you produced is not working either. It introduces “3D” characters that Paypal cannot parse. It goes to the Paypal homepage but not to the donation page that the link which I gave you in my first post builds from my parameters.

Thank you, H.Beer

P.S.: The hosted version of PHPlist does the same thing!

@hbeer54 Your explanation helps to be able to repeat the problem. It looks simply to be that the text message value is not escaped correctly, so the browser treats &curren as a currency symbol.
You can work around the problem by modifying one line of the phplist code. File admin/send_core.php line 908

<textarea id="textmessage" name="textmessage" cols="65" rows="20">' .$messagedata['textmessage'].'</textarea>

change to

<textarea id="textmessage" name="textmessage" cols="65" rows="20">' .htmlspecialchars($messagedata['textmessage']).'</textarea>
1 Like

Brilliant - that fixed it.

Thank you so much!